GuidesMigrate

Move from Vercel environment variables to Envlet

Keep one ENVLET_TOKEN in Vercel and let your functions pull the rest at boot.

15 min5 steps

Steps

  1. 01

    Sign in once

    Install the CLI and sign in. It shows a URL and a code; approve in the browser and you are in.

    Terminal
    npm install -g @envlet/cli
    envlet login
  2. 02

    Create a token per Vercel environment

    Add Vercel under Access with one token per environment, so a preview deploy can never read production.

    ci/vercelci
    Its own token, separate from your login.
    token
    envlet_•••••••• shown once
    opens
    one project, one environment
    expires
    always
  3. 03

    Set the one variable

    Add ENVLET_TOKEN in Vercel for each environment, then remove the rest.

    Terminal
    vercel env add ENVLET_TOKEN production
    vercel env add ENVLET_TOKEN preview
  4. 04

    Inject at boot

    For Next.js, call inject() in instrumentation.ts. Edge functions use load().

    instrumentation.ts
    import { inject } from "@envlet/sdk";
    
    export async function register() {
      await inject();
    }
  5. 05

    Or run the migrate prompt

    With the Envlet MCP server in Claude Code, Cursor, or Codex, the migrate prompt does every step above. Values never enter the conversation.

    Claude Code
    claude mcp add --scope user envlet -- npx -y @envlet/cli mcp

Stop pasting .env files.

One command. The right values for whoever runs it.