env-vars

Manage Vercel and Next.js environment variables with CLI workflows and OIDC token handling.

Updated May 16, 2026
One-click install
npx skills add https://github.com/MohammedHTahir/vibe-coding-platform --skill env-vars-mohammedhtahir
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: env-vars
Source: https://github.com/MohammedHTahir/vibe-coding-platform/tree/main/.kiro/vercel-plugin/skills/env-vars
Command: npx skills add https://github.com/MohammedHTahir/vibe-coding-platform --skill env-vars-mohammedhtahir

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill prevents misconfiguration and secret leakage when setting up or troubleshooting environment variables for a Next.js app running on Vercel.

Core Features & Use Cases

  • Vercel + Next.js environment variable hierarchy: Clarifies the correct load order across .env, .env.local, and environment-specific files so the right values win.
  • Vercel CLI workflows: Guides vercel env pull, vercel env add, vercel env ls, and vercel env rm for predictable secret management across environments (development, preview, production).
  • OIDC token handling for local development: Explains how VERCEL_OIDC_TOKEN is provisioned via vercel env pull, how long it typically lasts, and how to refresh it when it expires.
  • Safety guardrails: Warns against committing secrets and incorrectly exposing values via NEXT_PUBLIC_ variables.

Quick Start

Ask the AI to help you bootstrap a fresh machine by running vercel env pull .env.local and then verifying that every key listed in .env.example exists in your local .env.local file.

Frequently Asked Questions about env-vars

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I configure Vercel environment variables for Next.js without leaking secrets?

To configure Vercel environment variables safely, use the `vercel env pull .env.local` CLI command to sync secrets locally, and avoid committing `.env.local` files to version control to prevent secret leakage in your Next.js application.

What is the correct load order for Next.js environment variable files like .env and .env.local?

The correct Next.js environment variable load order prioritizes `.env.local` over `.env` to ensure local overrides take effect. Environment-specific files are loaded based on the active Vercel environment scope, preventing runtime configuration failures.

Why does my Vercel OIDC token expire during local development and how do I refresh it?

Your Vercel OIDC token expires because it is provisioned temporarily during local development. To refresh an expired `VERCEL_OIDC_TOKEN`, re-run the `vercel env pull` CLI command to provision a new token into your `.env.local` file.

How do I use the Vercel CLI to add, list, and remove environment variables across different scopes?

You can use the Vercel CLI to manage environment variables by running `vercel env add` to create secrets, `vercel env ls` to list them, and `vercel env rm` to delete them across development, preview, and production scopes.

When should I use NEXT_PUBLIC_ environment variables in Next.js?

You should use `NEXT_PUBLIC_` environment variables in Next.js only when a value must be exposed to the browser. Exercise caution as a safety guardrail because incorrectly applying this prefix will publicly leak the secret value.

What is the best way to bootstrap a fresh development environment with Vercel secrets?

The best way to bootstrap a fresh development environment is to run `vercel env pull .env.local` via the Vercel CLI, then verify that every key listed in your `.env.example` file exists in the newly generated `.env.local` file.