| name | customerio-multi-env-setup |
| description | Configure Customer.io multi-environment setup with workspace isolation.
Use when setting up dev/staging/prod workspaces, environment-aware
clients, or Kubernetes config overlays.
Trigger: "customer.io environments", "customer.io staging",
"customer.io dev prod", "customer.io workspace isolation".
|
| allowed-tools | Read, Write, Edit, Bash(npm:*), Bash(kubectl:*), Glob, Grep |
| version | 1.14.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","customer-io","multi-environment","kubernetes"] |
| compatibility | Designed for Claude Code |
Customer.io Multi-Environment Setup
Overview
Configure isolated Customer.io environments for dev, staging, and production: separate workspaces per environment, typed configuration with validation, environment-aware client wrappers, Kubernetes ConfigMap overlays, and data isolation verification.
Prerequisites
- Customer.io account with multiple workspaces (create at fly.customer.io)
- Environment variable management (dotenv, secrets manager)
- CI/CD pipeline for per-environment deployment
Workspace Strategy
| Environment | Workspace Name | Purpose | Dry Run | Data |
|---|
| Local dev | myapp-dev | Individual developer testing | Optional | Fake/test data |
| CI | myapp-ci | Automated test runs | No | Auto-cleaned test data |
| Staging | myapp-staging | Pre-production validation | No | Subset of real data |
| Production | myapp-prod | Live users | No | Real user data |
Each workspace has its own Site ID, Track API Key, and App API Key. Create workspaces at Settings > Workspace Settings.
Instructions
Step 1: Typed Environment Configuration
import { RegionUS, RegionEU } from "customerio-node";
type CioEnvironment = "development" | "ci" | "staging" | "production";
interface CioEnvConfig {
siteId: string;
trackApiKey: string;
appApiKey: ;
: | ;
: ;
: | | | ;
: ;
}
(): {
(!config.) ();
(!config.) ();
(env === && config.) {
();
}
(env === && config.) {
();
}
}
(): {
env = (process.. ?? ) ;
region = process.. === ? : ;
: = {
: process.. ?? ,
: process.. ?? ,
: process.. ?? ,
region,
: process.. === ,
: (process.. ) ?? (env === ? : ),
: process.. ?? (env === ? : ),
};
(config, env);
config;
}