Transfer env vars from Val Town
Add your app's environment variables to an Easel project.
Move only the variables your code reads with Deno.env.get. Skip the ones Val
Town added for its own services. Give Preview its own test credentials where a
service offers them, so a preview can't change production data.
Values you already have
If you have the values elsewhere, such as in a password manager, add them in the dashboard:
- Open Project settings → Environment Variables.
- Paste the contents of a
.envfile into a key field. - Choose Preview or Production, keep Sensitive on, and choose Add.
Values only Val Town has
A val's variables can only be read by code running in that val. Before
December 10, 2026, follow the first three steps of Val Town's
Transfer env vars guide
to encrypt them inside the original val. That leaves private.pem and
secrets.encrypted.json in a folder on your machine.
Then upload them with this script from that folder. It decrypts the values
locally and sends them to the Easel API without printing or saving
them, using a token limited to this project that expires in 10 minutes. Set
EASEL_TOKEN to a token from Settings → Access Tokens first.
transfer-secrets.mjs
The script refuses names with a public prefix such as VITE_, because
frameworks embed those in browser code. Add public configuration in the
dashboard.
Verify
Changes apply to new deployments, so deploy again and test a feature that uses each variable. Then delete the key folder and the encryption script in the val.
Next, follow the guide for each feature your app uses.