push-env-to-vercel.sh

_scripts/push-env-to-vercel.sh
#!/usr/bin/env bash
set -euo pipefail
# Push env vars from .env.production to Vercel using REST API upsert (encrypted)
# Usage:
# npm run env
# npm run env:prod
# npm run env:prev
TARGETS_CSV="${1:-production}" # development,preview,production (comma-separated)
ENV_FILE=".env.production"
VERCEL_BIN="${VERCEL_BIN:-vercel}"
ENV_TYPE="encrypted" # store as encrypted secrets
# --- sanity checks
if ! command -v "$VERCEL_BIN" >/dev/null 2>&1; then
echo "Error: Vercel CLI not found. Install with: npm i -g vercel" >&2
exit 1
fi
if [ ! -f "$ENV_FILE" ]; then

Showing the first 20 lines.

Get full code

Support

Talk to the developers of this project to learn more

We have been building professional websites for big clients for over 15 years. Gallop templates and blocks is our best foundation for SEO websites and web apps.

© 2026 Web Plant Media, LLC