Adding API keys and secrets

How to give your app access to another service without pasting a key into your code or a chat message.

Use the Secrets tab, not the chat

When your app needs a key for another service, add it in the Secrets tab of the workspace. Secrets added there are injected into both the sandbox preview and your production deploy, so the app behaves the same in each.

Do not paste keys into the chat. A key in a message becomes part of your project history; a key in Secrets does not.

Naming rules

  • Names use capitals, digits and underscores, and start with a letter — for example STRIPE_SECRET_KEY.
  • Names beginning with NEXT_PUBLIC_ are rejected, because anything with that prefix is shipped to the browser and would stop being a secret.
  • A handful of platform-owned names are reserved and cannot be used.

Knowing which keys you need

The Product Brief lists them. When a build depends on an outside service, the brief names the environment variable and says which integration it powers, so you can gather the keys before the build rather than during it.

Read next

  • Saving what visitors submitThe difference between collecting submissions and needing a real database, and how Sneh decides which your app gets.
  • Deploying your appTaking your app from preview to a real URL you can send to someone, and what is not supported yet.

Did this miss what you needed? Email hello@sneh.ai — or browse the rest of the help centre.