Framework support
Dotvault for Next.js
Dotvault for Next.js projects.
Next.js splits environment variables into server-only and client-exposed (the NEXT_PUBLIC_ prefix). Get that wrong and you either leak a secret to the browser or crash in production. Dotvault knows the conventions and labels every NEXT_PUBLIC_ variable as client-exposed as you edit, so the boundary is marked in the file rather than something you hold in your head. Put a value under that prefix which can only be a secret and it says so outright, gitignored file or not, because the bundle ships either way.
What you get
- →Detects Next.js automatically from package.json.
- →Recognises NEXTAUTH_URL, NEXTAUTH_SECRET, and the NEXT_PUBLIC_ prefix out of the box.
- →Warns when a NEXT_PUBLIC_ value can only be a secret: a Stripe or Anthropic secret key, a GitHub or Slack token, an AWS access key id, a webhook signing secret, or a key named SECRET, PASSWORD or PRIVATE_KEY.
- →Leaves publishable keys alone. A pk_live_ value under NEXT_PUBLIC_ is the prefix working as intended, and a warning you could only clear by deleting working code is one you would learn to scroll past.
- →Flags values matching a known secret pattern in any file git can see. That is the separate, older check, and it is the one that stays quiet on a gitignored file like .env.local.
- →Handles .env.local, .env.development, .env.production, and .env.test side by side.
Known environment variables
Dotvault recognises these variables when you open a Next.js project and surfaces helpful descriptions and warnings in the editor. Next.js is detected via next in package.json.
NEXT_PUBLIC_Client-exposed variable (Next.js)
NEXTAUTH_URLNextAuth.js callback URL
NEXTAUTH_SECRETNextAuth.js secret for JWT encryption
NEXT_TELEMETRY_DISABLEDDisable Next.js telemetry
NEXT_SHARP_PATHCustom path to sharp binary for image optimisation
HOSTNAMEServer hostname for standalone mode
PORTServer listen port
ANALYZEEnable bundle analyzer
Official Next.js docs: nextjs.org/docs