.env value, without a .env file on disk.
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 withek run --:
dev with whatever script starts your app. ek run fetches your project’s secrets and injects them as environment variables for that command only.
This covers next dev, next build and next start alike, since each runs as the wrapped command.
Accessing secrets in Next.js
Server code (Server Components, Route Handlers, API routes,getServerSideProps) reads secrets directly from process.env:
NEXT_PUBLIC_, and Next.js inlines them at build time. Run your build through ek run so the values are present:
Deploying
On Vercel, use the Vercel sync to push secrets to your project’s environment variables. For other hosts, pick the matching sync or run your server withek run.