Setting secrets via CLI
Inline key-value pairs
From a .env file
Listing secrets
Deleting a secret
Managing secrets from the dashboard
You can also view and manage secrets from the web app:- Open your app in the Yboard dashboard.
- Navigate to the Secrets tab.
- Add, edit, or remove secrets from the UI.
Environment-specific secrets
Secrets can be scoped to different deployment environments: development, preview, and production. This lets you use different API keys, database URLs, or service endpoints per environment.From the API
When interacting with the secrets API directly, specify the environment:From the dashboard
In the web app, secrets are managed per environment in the Secrets tab of your app. Switch between environments using the environment selector. Secrets set via the CLI default to the development environment.How secrets are used
Secrets are injected as environment variables into your deployed Cloudflare Worker at runtime. Access them in your server-side code:Database URL
TheDATABASE_URL secret is managed automatically by Yboard. When you run yboard deploy, the CLI fetches the database URL and uses it for the schema push. Your deployed app receives it as an environment variable at runtime.
Best practices
- Never commit
.envfiles to version control. - Use
yboard secrets set --env-fileto sync local env files to production. - Rotate secrets by setting them again with
yboard secrets set KEY=new-value.