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" | npx sproutboat secrets put STRIPE_KEY
# Or, when shell history is not a concern:
npx sproutboat secrets put STRIPE_KEY --value sk_test_exampleecho -n "$VALUE" | pnpm sproutboat secrets put STRIPE_KEY
# Or, when shell history is not a concern:
pnpm sproutboat secrets put STRIPE_KEY --value sk_test_exampleecho -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_exampleecho -n "$VALUE" | yarn sproutboat secrets put STRIPE_KEY
# Or, when shell history is not a concern:
yarn sproutboat secrets put STRIPE_KEY --value sk_test_exampleValues 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 devreads secrets from a.dev.varsfile next tosproutboat.jsoncor from the.envfiles, never both, aswrangler devdoes.sproutboat initadds.dev.varsto.gitignore. The process environment is not passed to the app. A declared secret with no value is a warning, anddevstill starts. See howdevfinds its files.- A standalone binary reads each secret from the environment variable of the same name.
sproutboat runsupplies them from env files at launch, and fails to start if a declared secret is missing, likewrangler deploy.