env-vars

Manage Vercel environment variables and local .env files securely.

3|Updated Mar 17, 2026
One-click install
npx skills add https://github.com/rauell1/safaricharge --skill env-vars-rauell1
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: env-vars
Source: https://github.com/rauell1/safaricharge/tree/main/.agents/skills/env-vars
Command: npx skills add https://github.com/rauell1/safaricharge --skill env-vars-rauell1

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It removes the friction of configuring Vercel and Next.js environment variables across local development, previews, and production while keeping secrets out of source control.

Core Features & Use Cases

  • Env file guidance: Explains the Next.js load order for .env, .env.local, and environment-specific files.
  • Vercel CLI workflows: Covers pulling, adding, listing, and removing variables with vercel env.
  • Secure configuration: Clarifies public vs server-only variables, OIDC token handling, and common setup pitfalls.
  • Use case: A team onboarding a new app can quickly verify required keys, refresh expired tokens, and keep production secrets scoped correctly.

Quick Start

Ask the skill to review your project's environment setup and tell you exactly which Vercel variables, files, and CLI steps you need.

Frequently Asked Questions about env-vars

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

FAQPage Schema
How do I manage Vercel environment variables without exposing secrets in Next.js?

To manage Vercel environment variables securely, use the vercel env CLI to pull, add, list, and remove values across development, preview, and production scopes. This keeps secrets out of source control while correctly scoping configuration for local and deployed Next.js workflows.

What is the load order for .env files in a Next.js project?

Next.js loads environment files in a specific order, starting with .env, followed by .env.local, and then environment-specific files like .env.development. Understanding this load order ensures local overrides work correctly without accidentally exposing production values.

How do I add and scope production secrets using the Vercel CLI?

You can add and scope production secrets using the vercel env CLI by specifying the target environment during the add command. This allows you to restrict sensitive variables to production, preview, or development, preventing accidental exposure across incorrect deployment targets.

Can I use NEXT_PUBLIC_ environment variables for server-only secrets in Vercel?

You cannot use NEXT_PUBLIC_ variables for server-only secrets because Next.js exposes NEXT_PUBLIC_ prefixed values to the browser. To keep secrets secure, you must omit the prefix so the variables remain strictly server-side and are never shipped to the client.

Why does my OIDC-authenticated configuration require token refresh handling in Vercel?

OIDC-authenticated configuration requires token refresh handling because expired tokens disrupt secure local and deployed environments. Correctly managing OIDC token refresh behavior ensures your Vercel environment variables and authenticated configuration remain valid during ongoing Next.js development sessions.