Configure Customer.io local development workflow. Use when setting up local testing, development environment, or offline development for Customer.io integrations. Trigger with phrases like "customer.io local dev", "test customer.io locally", "customer.io development environment", "customer.io sandbox".
/plugin marketplace add jeremylongshore/claude-code-plugins-plus-skills/plugin install customerio-pack@claude-code-plugins-plusThis skill is limited to using the following tools:
Set up an efficient local development workflow for Customer.io integrations with proper testing and isolation.
# .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
// 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();
// test/helpers/customerio-mock.ts
import { vi } from 'vitest';
export const mockCustomerIO = () => {
const mocks = {
identify: vi.fn().mockResolvedValue(undefined),
track: vi.fn().mockResolvedValue(undefined),
trackAnonymous: vi.fn().mockResolvedValue(undefined),
};
vi.mock('@customerio/track', () => ({
TrackClient: vi.fn().mockImplementation(() => mocks),
RegionUS: 'us',
RegionEU: 'eu',
}));
return mocks;
};
// Usage in tests
import { mockCustomerIO } from './helpers/customerio-mock';
describe('User Registration', () => {
const cioMocks = mockCustomerIO();
it('identifies user on signup', async () => {
await registerUser({ email: 'test@example.com' });
expect(cioMocks.identify).toHaveBeenCalledWith(
expect.any(String),
expect.objectContaining({ email: 'test@example.com' })
);
});
});
{
"scripts": {
"dev:cio": "CUSTOMERIO_DRY_RUN=true ts-node scripts/test-customerio.ts",
"dev:cio:live": "dotenv -e .env.development ts-node scripts/test-customerio.ts",
"test:cio": "vitest run --reporter=verbose tests/customerio/"
}
}
| Error | Cause | Solution |
|---|---|---|
| Wrong environment | Env vars not loaded | Use dotenv or env-specific files |
| Dev events in prod | Environment check failed | Verify NODE_ENV is set correctly |
| Mock not working | Import order issue | Mock before importing client |
After setting up local dev, proceed to customerio-sdk-patterns for production-ready patterns.
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems. Create original algorithmic art rather than copying existing artists' work to avoid copyright violations.
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.
Create beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.