How do I set environment variables and secrets?

Every service reads its configuration from environment variables — API keys, database URLs, feature flags, and anything else you don't want hard-coded.

Set them

Open your service in the console and use its environment variables editor to add each key and value. Save, and Forte redeploys the service so the new values take effect. Websites work the same way.

Notes

  • Values are stored securely and injected into your running container. Your app reads them the normal way — process.env, os.environ, System.getenv, and so on.
  • Treat every value as a secret; there's no separate "public vs. secret" split you need to configure.
  • Values your app needs while it builds are configured on the service too, so a build that depends on a token still gets it.

Point a website at a service

If a website needs one of your service's URLs (for example NEXT_PUBLIC_API_URL), connect the service from the website's Configuration tab instead of pasting the URL. The website gets an environment variable set to the service's Forte domain or an active custom domain, and rebuilds whenever you change the connection. See Connect a service's URL.

For the deployment flow around this, see Deploying Services.

Related questions

Still need help?

If this didn't answer your question, our team is one message away.

Contact support