Environment variables
Which values from your code reach your pages, how to add a key your app needs, and how Dessn keeps it.
Dessn runs your app without your .env file. Most apps need nothing more: where your code would stop without a key,
Dessn gives it an obviously fake stand-in of the right shape, and the page draws.
Values from your repository
If your repository has env files, Dessn reads the values your pages are meant to see, as your build tool would:
- Only public values. Names that start with
VITE_,NEXT_PUBLIC_,PUBLIC_,REACT_APP_,EXPO_PUBLIC_,REDWOOD_ENV_orPLASMO_PUBLIC_. - From your env files:
.env,.env.local,.env.development,.env.development.localand the like, the files your build tool reads for local development. - Never server values. A name without a public prefix, such as
DATABASE_URLorSTRIPE_SECRET_KEY, never goes into a page.
Public values go into the page, as they do in your own app, so anyone who can open the frame can see them. A
folder upload leaves every .env file on your computer, so a folder project
starts with none.
Add a key your app needs
Some pages only look right with a real key, such as a map or a payments form. Select the frame and ask the design agent to use your real key ("Use our real Mapbox key on this page"). It shows a secure card in the chat:
Paste the value
The card is titled Add and the variable's name. The field hides what you type.
Press Save
The value is saved for the project and never posted in the chat. Press Skip for now to carry on without it.
If setup stops for a value, the setup card names it (The … setting your app needs): press Add it, paste the value and press Resume setup.
Any editor can add a value. Registry tokens for private packages are added by team owners and admins.
How Dessn keeps them
Keys and tokens you add are encrypted when you save them and never shown again in Dessn; your app gets them only when it
runs. A key with a public prefix, such as VITE_ or NEXT_PUBLIC_, goes into the page as it does in your own app, so
anyone who can open the frame can see it. Use a key made for testing where you can, and keep live secrets out of
public-prefixed values.
Titles set in Kalice, Claude Type, designed by Margot Lévêque.