Skip to content
sproutboat
Esc
↑↓navigate↵open⌘Jpreview
On this page

Secrets

Values set with the CLI, never in sproutboat.jsonc, read as a plain string.

Configuration

"secrets": ["STRIPE_KEY"]

Only the binding name goes in the config. Set the value with the CLI after the project’s first deploy:

echo -n "$VALUE" | bunx sproutboat secrets put STRIPE_KEY
# Or, when shell history is not a concern:
bunx sproutboat secrets put STRIPE_KEY --value sk_test_example
echo -n "$VALUE" | npx sproutboat secrets put STRIPE_KEY
# Or, when shell history is not a concern:
npx sproutboat secrets put STRIPE_KEY --value sk_test_example

Values are stored encrypted, up to 8 KiB each. A new value applies from the next deploy.

Usage

env.STRIPE_KEY // -> plain string

Local and standalone values

  • sproutboat dev reads secrets from a .dev.vars file next to sproutboat.jsonc, one KEY=value per line. sproutboat init adds it to .gitignore.
  • A standalone binary reads each secret from the environment variable of the same name.

Was this page helpful?