# Supabase Multi Env Setup

> Configure Supabase across development, staging, and production environments. Use when setting up multi-environment deployments, configuring per-environment secrets, or implementing environment-specific Supabase configurations. Trigger with phrases like "supabase environments", "supabase staging", "supabase dev prod", "supabase environment setup", "supabase config by env".

- Skill: `tools-only/supabase-multi-env-setup` (Agent Skill, multi-file: 3 files)
- Install (CLI): `npx skillmds add tools-only/supabase-multi-env-setup`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tools-only/supabase-multi-env-setup/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- License: MIT
- Author: tools-only (https://skillmd.com/u/tools-only)
- Updated: 2026-09-08
- Page: https://skillmd.com/skills/tools-only/supabase-multi-env-setup

---


# Supabase Multi Env Setup

## Prerequisites
- Separate Supabase accounts or API keys per environment
- Secret management solution (Vault, AWS Secrets Manager, etc.)
- CI/CD pipeline with environment variables
- Environment detection in application

## Instructions

### Step 1: Create Config Structure
Set up the base and per-environment configuration files.

### Step 2: Implement Environment Detection
Add logic to detect and load environment-specific config.

### Step 3: Configure Secrets
Store API keys securely using your secret management solution.

### Step 4: Add Environment Guards
Implement safeguards for production-only operations.

## Output
- Multi-environment config structure
- Environment detection logic
- Secure secret management
- Production safeguards enabled

## Error Handling

See `{baseDir}/references/errors.md` for comprehensive error handling.

## Examples

See `{baseDir}/references/examples.md` for detailed examples.

## Resources
- [Supabase Environments Guide](https://supabase.com/docs/environments)
- [12-Factor App Config](https://12factor.net/config)

