Documentation Index
Fetch the complete documentation index at: https://docs.envless.cloud/llms.txt
Use this file to discover all available pages before exploring further.
The rule
Two imports
/serverexposes every variable. Use in API routes, server components, server actions, middleware, scripts, and background jobs./clientexposes only variables you’ve markedclientin the dashboard. Use in browser code,'use client'files, and any module that ships to the browser.
Visibility flag
Every variable in the Envless dashboard has a visibility setting:| Visibility | Available in /server | Available in /client | Bundling |
|---|---|---|---|
server (default) | ✅ | ❌ — type error and runtime throw | Never enters client chunks |
client | ✅ | ✅ | Inlined as a string literal at build time |
How values reach the browser
Client variables can’t be fetched at runtime in the browser — that would require shipping the decryption key. Instead they’re inlined at build time:NEXT_PUBLIC_* and Vite’s VITE_* — envless just owns the flagging in one place instead of relying on prefix discipline.
What ships where
| Server chunk | Client chunk | |
|---|---|---|
| Loader code | ✅ runs at boot | ❌ stripped |
| Decryption key | ✅ from cache or ENVLESS_TOKEN | ❌ never |
| Server-flagged values | ✅ live, fetched at boot | ❌ not present |
| Client-flagged values | ✅ live | ✅ inlined as literals |
The four layers of enforcement
Type errors
envless types generates two separate module declarations. env.STRIPE_SECRET from /client doesn’t autocomplete and fails tsc.Bundler strip
The build plugin only inlines
client-flagged keys into client chunks. Server keys referenced in client code resolve to undefined.Next.js example
'use client' file importing /server fails at lint. Even with lint disabled, server variables are undefined at runtime — loud immediate failure, not silent leak.