customerio-known-pitfalls

Featured

Identify and avoid Customer.io anti-patterns and gotchas. Use when reviewing integrations, onboarding developers, or auditing existing Customer.io code. Trigger: "customer.io mistakes", "customer.io anti-patterns", "customer.io gotchas", "customer.io pitfalls", "customer.io code review".

AI & Automation 2,926 stars 433 forks Updated yesterday MIT

Install

View on GitHub

Quality Score: 99/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Customer.io Known Pitfalls ## Overview The 12 most common Customer.io integration mistakes, with the wrong pattern, the correct pattern, and why it matters. Use this as a code review checklist and developer onboarding reference. ## The Pitfall Catalog ### Pitfall 1: Wrong API Key Type ```typescript // WRONG — using Track API key for transactional messages const api = new APIClient(process.env.CUSTOMERIO_TRACK_API_KEY!); // Gets 401 because App API uses a DIFFERENT bearer token // CORRECT — use the App API key const api = new APIClient(process.env.CUSTOMERIO_APP_API_KEY!); ``` **Why:** Customer.io has two separate authentication systems. Track API uses Basic Auth (Site ID + Track Key). App API uses Bearer Auth (App Key). They are not interchangeable. ### Pitfall 2: Millisecond Timestamps ```typescript // WRONG — JavaScript Date.now() returns milliseconds await cio.identify("user-1", { created_at: Date.now(), // 1704067200000 → year 55976 }); // CORRECT — Customer.io expects Unix seconds await cio.identify("user-1", { created_at: Math.floor(Date.now() / 1000), // 1704067200 }); ``` **Why:** Customer.io accepts millisecond values without error but interprets them as seconds, resulting in dates thousands of years in the future. Segments using date comparisons silently break. ### Pitfall 3: Track Before Identify ```typescript // WRONG — tracking before identifying creates orphaned events await cio.track("new-user", { name: "signed_up", data: {} }); //...

Details

Author
jeremylongshore
Repository
jeremylongshore/claude-code-plugins-plus-skills
Created
1 years ago
Last Updated
yesterday
Language
Python
License
MIT

Integrates with

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category