process.env.NAME, and nobody can read it
back, you and Bankroll included.
This page is for an app that Bankroll hosts: one made with
bankroll apps create or in the Bankroll app. An app on your own origin
sets its environment variables where it is hosted.Set a secret
You need version 1.3.0 or later of the Bankroll CLI.bankroll --version
prints yours, and npm i -g @joinbankroll/cli@latest updates it.
In your app’s folder:
Test and live
Your app has a test version and a live version, and each has a value of its own. With no option, a command is for both.--test or --live names one,
so a test database and a live database can sit under the same name:
set and rm build the
versions again and show the build, the way bankroll wait
does. Several names in one command share one build, and --no-rebuild leaves
the build for later. A rebuild counts as one of your builds for the day.
The live version is built again only while it serves the commit that its
live branch holds. If you pushed to live and that build did not go
through, the secret is read at your next publish.
Read a secret
Read it on the server, in a route handler or a server module:- Never read a secret in a client component, and never send one to the browser.
- Write your app so that it runs without the secret, with that one feature closed. A fresh clone of your app does not have it.
- To use the secret on your own computer, put the value in
.env.local. Git ignores that file, and Bankroll never sees it.
List and remove
Names
A name is capital letters, digits and underscores, and starts with a letter:KALSHI_API_KEY, DATABASE_URL. Three kinds of name are refused:
A version holds up to 20 secrets, each up to 8 KB.