Skip to main content
SvelteKit separates server-only secrets from public values through its $env modules, so secrets stay out of the browser bundle.

Local development

To run your app locally with Enkryptify secrets, install the Enkryptify CLI and link it to your project, then prefix your usual start script with ek run --:
Replace dev with whatever script starts your app. ek run fetches your project’s secrets and injects them as environment variables for that command only.

Accessing secrets in SvelteKit

Server-only secrets come from $env/static/private (or $env/dynamic/private) and cannot be imported into client code:
Public values must be prefixed with PUBLIC_ and come from $env/static/public:
Name your Enkryptify secrets accordingly: PUBLIC_ for anything the browser may see, no prefix for server-only secrets.

Deploying

Use the sync for your host (for example the Vercel sync) to provide the same variables in production.