jeremylongshore/claude-code-plugins-plus-skills
customerio-pack
plugins/saas-packs/customerio-pack/skills/customerio-local-dev-loop/SKILL.md
January 22, 2026
Select agents to install to:
npx add-skill https://github.com/jeremylongshore/claude-code-plugins-plus-skills/blob/main/plugins/saas-packs/customerio-pack/skills/customerio-local-dev-loop/SKILL.md -a claude-code --skill customerio-local-dev-loopInstallation paths:
.claude/skills/customerio-local-dev-loop/# Customer.io Local Dev Loop
## Overview
Set up an efficient local development workflow for Customer.io integrations with proper testing and isolation.
## Prerequisites
- Customer.io SDK installed
- Separate development workspace in Customer.io (recommended)
- Environment variable management tool (dotenv)
## Instructions
### Step 1: Create Environment Configuration
```bash
# .env.development
CUSTOMERIO_SITE_ID=dev-site-id
CUSTOMERIO_API_KEY=dev-api-key
CUSTOMERIO_REGION=us
# .env.production
CUSTOMERIO_SITE_ID=prod-site-id
CUSTOMERIO_API_KEY=prod-api-key
CUSTOMERIO_REGION=us
```
### Step 2: Create Dev Client Wrapper
```typescript
// lib/customerio.ts
import { TrackClient, RegionUS, RegionEU } from '@customerio/track';
const getRegion = () => {
return process.env.CUSTOMERIO_REGION === 'eu' ? RegionEU : RegionUS;
};
const isDevelopment = process.env.NODE_ENV !== 'production';
class CustomerIOClient {
private client: TrackClient;
private dryRun: boolean;
constructor() {
this.client = new TrackClient(
process.env.CUSTOMERIO_SITE_ID!,
process.env.CUSTOMERIO_API_KEY!,
{ region: getRegion() }
);
this.dryRun = process.env.CUSTOMERIO_DRY_RUN === 'true';
}
async identify(userId: string, attributes: Record<string, any>) {
if (this.dryRun) {
console.log('[DRY RUN] Identify:', { userId, attributes });
return;
}
if (isDevelopment) {
attributes._dev = true;
attributes._dev_timestamp = new Date().toISOString();
}
return this.client.identify(userId, attributes);
}
async track(userId: string, eventName: string, data?: Record<string, any>) {
if (this.dryRun) {
console.log('[DRY RUN] Track:', { userId, eventName, data });
return;
}
const eventData = {
name: isDevelopment ? `dev_${eventName}` : eventName,
data: { ...data, _dev: isDevelopment }
};
return this.client.track(userId, eventData);
}
}
export const cio = new CustomerIOClient();
```