This guide explains how vercel-env-checker works under the hood.
The tool uses the Vercel API to fetch environment variables from your projects and searches for specific text within their values.
┌─────────────────────────────────────────────────────────┐
│ vercel-env-checker │
├─────────────────────────────────────────────────────────┤
│ │
│ ┌──────────┐ ┌──────────┐ ┌──────────────────┐ │
│ │ CLI │───▶│ Index │───▶│ VercelAPI │ │
│ │ (bin/) │ │(src/) │ │ (vercel-api.ts) │ │
│ └──────────┘ └──────────┘ └────────┬─────────┘ │
│ │ │
│ ┌──────────┐ ┌──────────┐ │ │
│ │ run.ts │───▶│ Config │◀────────────┘ │
│ │(wizard) │ │(config.ts) │
│ └──────────┘ └──────────────────────────────────────┘
│ │
└─────────────────────────────────────────────────────────┘
Command-line interface using Commander.js. Provides commands:
login- Authenticate with Vercellogout- Clear credentialscheck-value/val- Search env var valuesrun- Interactive wizard
Main application logic:
- Authentication handling
- Project fetching and caching
- Value search with concurrency control
- Results formatting with tables
HTTP client for Vercel API:
- Token validation
- Project listing
- Environment variable retrieval
Local storage:
- Token management
- Cache handling
- Config file at
~/.vercel-env-checker/
Step-by-step CLI with:
- Keyboard navigation (arrow keys, Space, Enter)
- Project selection UI
- Environment selection
The tool uses these Vercel API endpoints:
| Endpoint | Purpose |
|---|---|
GET /v6/user |
Validate token |
GET /v6/deployments |
List projects |
GET /v6/projects/{id}/env |
Get environment variables |
To avoid hitting Vercel's API limits:
- Concurrency: Max 5 parallel requests
- Rate: 100ms delay between requests (~10 req/sec)
- Retries: 3 attempts with exponential backoff
| Data | Cached | Duration | Notes |
|---|---|---|---|
| Project list | Yes | 1 hour | Stable, rarely changes |
| Env var metadata | Yes | 5 minutes | Key names, types, targets only |
| Decrypted values | NEVER | - | Fetched fresh each time |
Security: Decrypted/sensitive values are never cached. Only raw API metadata (key names, encryption types, target environments) is stored locally.
1. User provides query (e.g., "postgres://")
│
▼
2. Fetch all projects from Vercel API
│
▼
3. For each project (with concurrency limit):
- Fetch env variables
- Search for query in values
│
▼
4. Display results in formatted table
- Token Storage: Stored locally in plain JSON
- No Cloud Storage: All data stays on your machine
- No Caching of Secrets: Decrypted values never cached
- HTTPS: All API calls use HTTPS
- Invalid tokens → Clear error message
- Rate limited → Automatic retry with backoff
- Network errors → Graceful degradation, skip failed projects
To add new commands:
- Add command to
bin/cli.tsusing Commander - Implement logic in
src/index.ts - Add tests if needed