Variables and secrets
Configuration the app reads from its environment.
Set, list and remove
$ shim env set LOG_LEVEL=info REGION=eu $ shim env list $ shim env unset REGION
Changes reach the running app in a moment. You do not need to deploy again. The same can be done in the Variables section of the app in the dashboard, which can also take a pasted .env file.
Secrets
$ shim env set STRIPE_KEY=sk_live_... --secretA secret is write-only. Once saved, its value cannot be read back with the command line or the dashboard; it can only be replaced or removed. Keep your own copy.
To keep a secret out of your shell history, give - as the value and pipe it in:
$ printf %s "$STRIPE_KEY" | shim env set STRIPE_KEY=- --secretVariables that are not secret can also be listed in the [env] table of shim.toml. Secrets never go there.
Names
A name starts with a letter and uses letters, digits and underscores, up to 128 characters. These are reserved:
PORT,TZ,LD_PRELOAD,LD_LIBRARY_PATH- anything starting with
AWS_,LAMBDA_,SHIM_or an underscore
Variables Shim sets
| Name | When | Value |
|---|---|---|
PORT | always | 8080 |
DATABASE_URL | while the app has a database | the connection string to use from the app |
DATABASE_URL_UNPOOLED | while the app has a database | a direct connection, for migrations and tools that hold one session |
SHIM_APP_TOKEN | when the app may call another app | the token to send |
These show up as secrets under Set by Shim, cannot be changed or removed by hand, and count towards the app's variable limits.
Your own database
To use a database you already run, set DATABASE_URL yourself, like any other variable. Shim leaves it alone and sets no DATABASE_URL_UNPOOLED. An app uses one or the other: while it has a Shim database you cannot set DATABASE_URL, and while you have set it Shim will not create one. Remove yours first to switch.
Limits
- One value can be at most 2,048 bytes.
- All names and values of one app must fit in 3,500 bytes together.
- The number of variables depends on the plan.