On this page
An API key is a password that lets your app use another service, such as an email provider or payment processor. Anyone who sees it can use that service as you, so it must never sit in your app's visible code or in a chat. Put it in Secrets. Your backend code reads each secret by its name, and the value stays hidden once saved.
You need Swarmz Cloud turned on.
Add a secret#
Step 1: Open Secrets
Click Tools, then Cloud, then Secrets. A new project says "No secrets yet".
Step 2: Click Add secret
Enter a Secret name in capitals with underscores, such as
WEATHER_API_KEY, and paste the Secret value. You can add several at once.Step 3: Save
You see the secret listed, with its value hidden. Tell the AI the name so it uses it: "Use the WEATHER_API_KEY secret to call the weather service from a server function."
Names must be unique. If a name is reserved by the platform you see "This name is reserved and managed by the platform".
Let the AI ask you for a key#
When your app needs a key, the AI shows a secure form instead of asking you to paste it in the chat. Type the value there. It goes straight to Secrets and is never echoed back or written into your code. If you paste something that looks like a key into the chat, Swarmz warns you before it is sent and offers the secure form.
Rotate or delete a secret#
- Rotate secret replaces the value, for example after a key was shared by mistake. Paste the new value and save.
- Delete secret removes it. Anything that relies on it will stop working until you add it again.
- Secrets marked Managed belong to the platform, such as the key that powers AI in your app. Use Regenerate key to make a new one. The old key keeps working for 24 hours, so your app does not break while it updates. Managed secrets cannot be removed.
Good to know#
- Never put a secret in your frontend. Anything the visitor's browser can see is public. Secrets are used by server functions only. The AI knows this, but check if you edit code by hand.
- Stripe and PayPal keys go here too. See Use your own Stripe or PayPal account.
- People with view-only access see names only. Changing secrets needs edit access.
- You cannot read a saved value back. Keep the original in your password manager.
- Names starting with
SUPABASE_are hidden because the platform manages them.
Warning
If a key was ever pasted into a chat, a file or a screenshot, treat it as leaked. Create a new key at the service that issued it, put it in Secrets, and delete the old one there.
Common questions#
Can I see a secret's value later?
No. This protects it. Rotate it if you lost the value.
What is the difference between a secret and a connector?
A secret is a key your running app uses. A connector lets the Swarmz AI read or act on a service while you build. See Connect an integration.
Was this helpful?
Related articles
What is Swarmz Cloud?
Swarmz Cloud is the backend for your app: a database, user accounts, file storage and server functions, set up and looked after for you.Use your own Stripe or PayPal account
Have the AI build checkout with your own payment provider account. Your keys go in a secure form, never in chat or code.In Integrations and paymentsConnect an integration
Connect a tool like Gmail, Google Sheets, Slack or HubSpot once, then let the AI use it in any project in your workspace.In Integrations and paymentsAdd AI features to your app
Put chat, image generation, search and speech-to-text inside your own app, with no AI account or key to manage.In Integrations and payments
Still have a question?
Ask about this article, or talk to a person.