customerio-reliability-patterns

Featured

Implement Customer.io reliability and fault-tolerance patterns. Use when building circuit breakers, fallback queues, idempotency, or graceful degradation for Customer.io integrations. Trigger: "customer.io reliability", "customer.io resilience", "customer.io circuit breaker", "customer.io fault tolerance".

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 Reliability Patterns ## Overview Implement fault-tolerant Customer.io integrations: circuit breaker (stop cascading failures), retry with jitter (handle transient errors), fallback queue (survive outages), idempotency guard (prevent duplicates), and graceful degradation (never crash your app for analytics). ## Prerequisites - Working Customer.io integration - Understanding of failure modes (429, 5xx, timeouts, DNS failures) - Redis (recommended for queue-based patterns) ## Instructions ### Pattern 1: Circuit Breaker ```typescript // lib/circuit-breaker.ts type CircuitState = "CLOSED" | "OPEN" | "HALF_OPEN"; export class CircuitBreaker { private state: CircuitState = "CLOSED"; private failureCount = 0; private successCount = 0; private lastFailureTime = 0; constructor( private readonly failureThreshold: number = 5, private readonly successThreshold: number = 3, private readonly resetTimeoutMs: number = 30000 ) {} get currentState(): CircuitState { if (this.state === "OPEN") { // Check if enough time has passed to try again if (Date.now() - this.lastFailureTime > this.resetTimeoutMs) { this.state = "HALF_OPEN"; this.successCount = 0; } } return this.state; } async execute<T>(fn: () => Promise<T>): Promise<T> { if (this.currentState === "OPEN") { throw new Error("Circuit breaker is OPEN — Customer.io calls blocked"); } try { const result = await fn(); ...

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