Skip to content
customerio-upgrade-migration logo

Customer.io Upgrade & Migration

customerio-upgrade-migration

Plan and execute Customer.io SDK upgrades. Use when upgrading SDK versions, migrating integrations, or updating to new API versions. Trigger with phrases like "upgrade customer.io", "customer.io migration", "update customer.io sdk", "customer.io version".

SKILL.md

Full skill instructions

Customer.io Upgrade & Migration

Overview

Plan and execute Customer.io SDK upgrades and migrations safely.

Prerequisites

  • Current SDK version identified
  • Test environment available
  • Rollback plan prepared

Instructions

Step 1: Assess Current State

#!/​bin/​bash
# assess-customerio.sh

echo "=== Customer.io SDK Assessment ==="

# Node.js SDK
echo "Node.js SDK:"
npm list @customerio/​track 2>/​dev/​null || echo "Not installed"
npm list customerio-node 2>/​dev/​null || echo "Legacy SDK not installed"

# Python SDK
echo -e "\nPython SDK:"
pip show customerio 2>/​dev/​null || echo "Not installed"

# Check for latest versions
echo -e "\nLatest versions available:"
npm view @customerio/​track version 2>/​dev/​null
pip index versions customerio 2>/​dev/​null | head -1

Step 2: Review Breaking Changes

## Customer.io SDK Changelog Review

### @customerio/​track (Node.js)
- v1.x -> v2.x: Updated to ESM modules
- v2.x -> v3.x: Changed region configuration

### customerio (Python)
- v1.x -> v2.x: Async client support added

### API Changes
- Check https://customer.io/​docs/​changelog/

Step 3: Create Migration Plan

// migration-plan.ts
interface MigrationPlan {
  currentVersion: string;
  targetVersion: string;
  breakingChanges: string[];
  codeChanges: CodeChange[];
  testCases: string[];
  rollbackProcedure: string[];
  timeline: Timeline;
}

const migrationPlan: MigrationPlan = {
  currentVersion: '1.2.0',
  targetVersion: '2.0.0',
  breakingChanges: [
    'Region now required in constructor',
    'Event data structure changed',
    'Error types updated'
  ],
  codeChanges: [
    {
      file: 'lib/​customerio.ts',
      before: `new TrackClient(siteId, apiKey)`,
      after: `new TrackClient(siteId, apiKey, { region: RegionUS })`
    },
    {
      file: 'lib/​customerio.ts',
      before: `client.track(userId, eventName, data)`,
      after: `client.track(userId, { name: eventName, data })`
    }
  ],
  testCases: [
    'Identify user creates/​updates profile',
    'Track event records in activity',
    'Error handling catches API errors',
    'Rate limiting respects limits'
  ],
  rollbackProcedure: [
    'Revert package.json to previous version',
    'Run npm install',
    'Deploy previous container image',
    'Verify with smoke tests'
  ],
  timeline: {
    preparation: '1 day',
    staging: '2 days',
    production: '1 day',
    monitoring: '3 days'
  }
};

Step 4: Update Dependencies

# Upgrade Node.js SDK
npm install @customerio/​track@latest

# Or upgrade to specific version
npm install @customerio/​[email protected]

# Upgrade Python SDK
pip install --upgrade customerio

# Or specific version
pip install customerio==2.0.0

Step 5: Update Code for Breaking Changes

// Before (v1.x)
import { CustomerIO } from 'customerio-node';
const cio = new CustomerIO(siteId, apiKey);
await cio.track(userId, 'event_name', { key: 'value' });

// After (v2.x - @customerio/​track)
import { TrackClient, RegionUS } from '@customerio/​track';
const client = new TrackClient(siteId, apiKey, { region: RegionUS });
await client.track(userId, { name: 'event_name', data: { key: 'value' } });

Step 6: Migration Test Suite

// tests/​migration.test.ts
import { describe, it, expect, beforeAll } from 'vitest';
import { TrackClient, RegionUS } from '@customerio/​track';

describe('Customer.io Migration Tests', () => {
  let client: TrackClient;

  beforeAll(() => {
    client = new TrackClient(
      process.env.CUSTOMERIO_SITE_ID!,
      process.env.CUSTOMERIO_API_KEY!,
      { region: RegionUS }
    );
  });

  it('should identify user with new SDK', async () => {
    await expect(
      client.identify('migration-test-user', {
        email: '[email protected]',
        _migration_test: true
      })
    ).resolves.not.toThrow();
  });

  it('should track event with new format', async () => {
    await expect(
      client.track('migration-test-user', {
        name: 'migration_test_event',
        data: { version: '2.0.0' }
      })
    ).resolves.not.toThrow();
  });

  it('should handle errors correctly', async () => {
    const badClient = new TrackClient('invalid', 'invalid', { region: RegionUS });
    await expect(
      badClient.identify('test', { email: '[email protected]' })
    ).rejects.toThrow();
  });
});

Step 7: Staged Rollout

// lib/​feature-flags.ts
const migrationFlags = {
  useNewSDK: process.env.USE_NEW_CIO_SDK === 'true',
  newSDKPercentage: parseInt(process.env.NEW_SDK_PERCENTAGE || '0', 10)
};

// Gradually roll out new SDK
function shouldUseNewSDK(userId: string): boolean {
  if (!migrationFlags.useNewSDK) return false;

  // Hash-based percentage rollout
  const hash = userId.split('').reduce((a, b) => {
    a = ((a << 5) - a) + b.charCodeAt(0);
    return a & a;
  }, 0);

  return Math.abs(hash % 100) < migrationFlags.newSDKPercentage;
}

// Usage
if (shouldUseNewSDK(userId)) {
  await newClient.identify(userId, attributes);
} else {
  await legacyClient.identify(userId, attributes);
}

Step 8: Post-Migration Verification

#!/​bin/​bash
# verify-migration.sh

echo "=== Post-Migration Verification ==="

# Check new SDK is installed
echo "SDK Version:"
npm list @customerio/​track

# Run smoke tests
echo -e "\nRunning smoke tests..."
npm run test:customerio

# Check error rates
echo -e "\nError rates (last 1 hour):"
# Query your monitoring system here

# Check delivery rates
echo -e "\nDelivery metrics:"
# Query Customer.io reporting API or dashboard

Migration Checklist

  • Current version documented
  • Target version selected
  • Breaking changes reviewed
  • Code changes identified
  • Tests written for migration
  • Staging deployment successful
  • Production rollout plan ready
  • Rollback procedure tested
  • Monitoring enhanced
  • Team notified

Error Handling

IssueSolution
Breaking change missedRevert and add to change list
Performance regressionProfile and optimize or rollback
Unexpected errorsCheck error types changed

Resources

Next Steps

After successful migration, proceed to customerio-ci-integration for CI/​CD setup.

More skills from Dicklesworthstone

environment-setup-guide logo
Dicklesworthstone/pi_agent_rust

environment-setup-guide

Guide developers through setting up development environments with proper tools, dependencies, and configurations

1.8K 0
View
exa-policy-guardrails logo
Dicklesworthstone/pi_agent_rust

exa-policy-guardrails

Implement Exa lint rules, policy enforcement, and automated guardrails. Use when setting up code quality rules for Exa integrations, implementing pre-commit hooks, or configuring CI policy checks for Exa best practices. Trigger with phrases like "exa policy", "exa lint", "exa guardrails", "exa be...

1.8K 0
View
documenso-ci-integration logo
Dicklesworthstone/pi_agent_rust

documenso-ci-integration

Configure CI/CD pipelines for Documenso integrations. Use when setting up automated testing, deployment pipelines, or continuous integration for Documenso projects. Trigger with phrases like "documenso CI", "documenso GitHub Actions", "documenso pipeline", "documenso automated testing".

1.8K 0
View
openrouter-model-availability logo
Dicklesworthstone/pi_agent_rust

openrouter-model-availability

Build check model availability and implement fallback chains. Use when building resilient systems or handling model outages. Trigger with phrases like 'openrouter availability', 'openrouter fallback', 'openrouter model down', 'openrouter health check'.

1.8K 0
View
langfuse-enterprise-rbac logo
Dicklesworthstone/pi_agent_rust

langfuse-enterprise-rbac

Configure Langfuse enterprise organization management and access control. Use when implementing team access controls, configuring organization settings, or setting up role-based permissions for Langfuse projects. Trigger with phrases like "langfuse RBAC", "langfuse teams", "langfuse organization"...

1.8K 0
View
cursor-compliance-audit logo
Dicklesworthstone/pi_agent_rust

cursor-compliance-audit

Execute compliance and security auditing for Cursor usage. Triggers on "cursor compliance", "cursor audit", "cursor security review", "cursor soc2", "cursor gdpr". Use when analyzing or auditing cursor compliance audit. Trigger with phrases like "cursor compliance audit", "cursor audit", "cursor".

1.8K 0
View
apollo-ci-integration logo
Dicklesworthstone/pi_agent_rust

apollo-ci-integration

Configure Apollo.io CI/CD integration. Use when setting up automated testing, continuous integration, or deployment pipelines for Apollo integrations. Trigger with phrases like "apollo ci", "apollo github actions", "apollo pipeline", "apollo ci/cd", "apollo automated tests".

1.8K 0
View
python-script logo
Dicklesworthstone/pi_agent_rust

python-script

Create robust Python automation with full logging and safety checks. Use when tasks need complex data processing, authenticated API work, conditional file operations, or error handling beyond simple shell commands.

1.8K 0
View
posthog-multi-env-setup logo
Dicklesworthstone/pi_agent_rust

posthog-multi-env-setup

Configure PostHog across development, staging, and production environments. Use when setting up multi-environment deployments, configuring per-environment secrets, or implementing environment-specific PostHog configurations. Trigger with phrases like "posthog environments", "posthog staging", "po...

1.8K 0
View
ai-agents-architect logo
Dicklesworthstone/pi_agent_rust

ai-agents-architect

Expert in designing and building autonomous AI agents. Masters tool use, memory systems, planning strategies, and multi-agent orchestration. Use when: build agent, AI agent, autonomous agent, tool use, function calling.

1.8K 0
View
insecure-deserialization-checker logo
Dicklesworthstone/pi_agent_rust

insecure-deserialization-checker

Validate insecure deserialization checker operations. Auto-activating skill for Security Fundamentals. Triggers on: insecure deserialization checker, insecure deserialization checker Part of the Security Fundamentals skill category. Use when working with insecure deserialization checker functiona...

1.8K 0
View
path-traversal-finder logo
Dicklesworthstone/pi_agent_rust

path-traversal-finder

Manage path traversal finder operations. Auto-activating skill for Security Fundamentals. Triggers on: path traversal finder, path traversal finder Part of the Security Fundamentals skill category. Use when working with path traversal finder functionality. Trigger with phrases like "path traversa...

1.8K 0
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View