GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • secr
  • For AI agentsNew
  • Docs
  • Integrations
  • Blog
  • Login
  • Get Started

This view

  • Original page
  • New address

GeezerVison is showing secr.dev — secr — CLI-first Secrets Management for Teams

Quick Start

1. Install the package

npm install @secr/vercel

2. Create a CLI token

secr token create --name "vercel-prod"

3. Configure Vercel environment variables

In your Vercel project settings, go to Settings → Environment Variables and add the following:

VariableValueEnvironments
SECR_TOKENsecr_tok_...All
SECR_ORGmy-orgAll
SECR_PROJECTmy-projectAll

4. Update your build command

In Settings → General → Build & Development Settings, override the build command:

npx secr-vercel && next build

Replace next build with your framework's build command (e.g. vite build, remix build).

How It Works

  1. Read environment variables — secr-vercel reads SECR_TOKEN, SECR_ORG, SECR_PROJECT, and the target environment from Vercel's environment.
  2. Determine environment — Uses SECR_ENVIRONMENT if set, otherwise falls back to VERCEL_ENV (automatically set by Vercel to production, preview, or development).
  3. Pull secrets — Calls the secr API using the @secr/sdk to fetch all decrypted secrets for the resolved environment.
  4. Write .env.local — Writes the secrets as KEY=value pairs to .env.local in the working directory. Special characters and multiline values are properly escaped.
  5. Build proceeds — Your framework reads .env.local as usual during the build step.

Environment Variables

OptionTypeRequiredDescription
SECR_TOKENstringYessecr CLI token (secr_tok_...). Set in Vercel project settings.
SECR_ORGstringYesOrganization slug in secr.
SECR_PROJECTstringYesProject slug in secr.
SECR_ENVIRONMENTstringVERCEL_ENVOverride the secr environment. Falls back to VERCEL_ENV, then to "production".
SECR_API_URLstringhttps://api.secr.devsecr API base URL.

CLI Options

OptionTypeRequiredDescription
--outputstring.env.localOutput file path. Defaults to .env.local in the current directory.
Custom output path
npx secr-vercel --output .env.production && next build

Environment Mapping

When SECR_ENVIRONMENT is not set, the integration uses Vercel's VERCEL_ENV value to determine which secr environment to pull from.

Vercel ContextVERCEL_ENVsecr Environment
Productionproductionproduction
Previewpreviewpreview
Developmentdevelopmentdevelopment

To map Vercel's preview to a different secr environment (e.g. staging), set SECR_ENVIRONMENT=staging for the Preview environment scope in Vercel.

Troubleshooting

ErrorCauseFix
SECR_TOKEN environment variable is requiredThe token is not set in Vercel project settings.Add SECR_TOKEN to your Vercel environment variables.
SECR_ORG environment variable is requiredThe org slug is missing.Add SECR_ORG to your Vercel environment variables.
Secr API error: not_foundThe org, project, or environment slug does not match.Verify slugs with secr projects list and check for typos.
Build fails but .env.local is emptyThe secr-vercel command is not running before the build.Ensure the build command is npx secr-vercel && next build (with &&).

Security Notes

  • •Token storage — Store the SECR_TOKEN as a sensitive environment variable in Vercel (encrypted at rest). Never commit tokens to your repository.
  • •.gitignore — Ensure .env.local is in your .gitignore. Next.js does this by default, but verify for other frameworks.
  • •Dedicated token — Create a separate token for Vercel builds. If a token is compromised, you can revoke it without affecting other services.
  • •Environment scoping — You can scope Vercel environment variables to specific environments (Production, Preview, Development) to limit which builds can access production secrets.

Deploy with secrets from secr

npm install @secr/vercel

Create Free AccountBack to Docs
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.