# Secrets

> Store API keys and other private values for your backend functions.


Secrets are environment variables for your app's server, used by [backend functions](/docs/logic/backend-functions).

## Add a secret

1. Open **Dashboard → Secrets**.
2. Enter a name in `UPPER_SNAKE_CASE` (for example `STRIPE_API_KEY`) and the value.
3. Click **Save**. Your app restarts so the value takes effect.

In code, read it with `process.env.STRIPE_API_KEY` inside a function.

## Safety

- Values are encrypted at rest and never shown again after saving — only names are listed.
- Secrets are only available on the server. Never put them in client components.
- Names starting with `DRAFTSHIP_`, `NEXT_` or `NODE_` are reserved.
- When you deploy to Vercel from Draftship, your secrets are passed to that deployment. They are never committed to GitHub.

## Secrets in the chat

When the AI needs a key, it shows a form in the chat. Enter the key there. It's encrypted and saved here, and the AI only sees its name.

If you paste a recognized key into a chat message, Draftship saves it as a secret and replaces it in your message before the AI reads it. This works for well-known services such as OpenAI, Anthropic, Stripe, AWS, GitHub, Google and Slack, and for values labeled as a key or token, like `TMDB API key: ...`. For anything else, add it here yourself.
