> ## Documentation Index
> Fetch the complete documentation index at: https://docs.base44.com/llms.txt
> Use this file to discover all available pages before exploring further.

# secrets set

> Set one or more project secrets

Set secrets for your project. Secrets are available to your [backend functions](https://docs.base44.com/developers/backend/resources/backend-functions/overview.md) at runtime via [`secrets.get()`](https://docs.base44.com/developers/backend/resources/backend-functions/overview#read-secrets) from the built-in `base44:runtime` module.

A new or changed value reaches your deployed backend functions right away. If you've published your app from the app editor, the published version might keep the previous value until you publish again.

If a secret with the same name already exists, its value is overwritten. You can provide secrets as inline `KEY=VALUE` pairs or load them from an `.env` file.

## Usage

Set one or more secrets inline, separated by spaces:

```bash theme={null}
base44 secrets set <KEY=VALUE...>
```

Or load from an `.env` file:

```bash theme={null}
base44 secrets set --env-file <path>
```

> [!WARNING]
>
> You cannot combine inline KEY=VALUE pairs with `--env-file` in the same
> command.

## Arguments

| Argument | Description | Required |
| - | - | - |
| `<KEY=VALUE...>` | One or more KEY=VALUE pairs, separated by spaces. | Yes (unless using `--env-file`) |

## Flags

| Flag | Description |
| - | - |
| `--env-file <path>` | Path to a `.env` file containing `KEY=VALUE` pairs. |

## Example

```bash theme={null}
base44 secrets set API_KEY=sk-abc123 DATABASE_URL=postgres://localhost/mydb
```

## See also

* [`secrets list`](https://docs.base44.com/developers/references/cli/commands/secrets-list): List configured secrets
* [`secrets delete`](https://docs.base44.com/developers/references/cli/commands/secrets-delete): Delete one or more secrets
* [Backend Functions](https://docs.base44.com/developers/backend/resources/backend-functions/overview.md): Use secrets as environment variables in your functions


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.