---
name: customerio-debug-bundle-2fe88d12ef02
description: |
  Collect Customer.io debug evidence for support.
  Use when creating support tickets, reporting issues,
  or documenting integration problems.
  Trigger with phrases like "customer.io debug", "customer.io support ticket",
  "collect customer.io logs", "customer.io diagnostics".
allowed-tools: Read, Grep, Bash(curl:*)
version: 1.0.0
license: MIT
author: Jeremy Longshore <jeremy@intentsolutions.io>
---

# Customer.io Debug Bundle

## Overview
Collect comprehensive debug information for Customer.io support tickets and troubleshooting.

## Prerequisites
- Customer.io API credentials
- Access to application logs
- User ID or email of affected user

## Instructions

### Step 1: Create Debug Script
```bash
#!/bin/bash
# debug-customerio.sh

OUTPUT_DIR="customerio-debug-$(date +%Y%m%d-%H%M%S)"
mkdir -p "$OUTPUT_DIR"

echo "Customer.io Debug Bundle" > "$OUTPUT_DIR/report.txt"
echo "Generated: $(date -u +%Y-%m-%dT%H:%M:%SZ)" >> "$OUTPUT_DIR/report.txt"
echo "" >> "$OUTPUT_DIR/report.txt"

# 1. API Connectivity Test
echo "=== API Connectivity ===" >> "$OUTPUT_DIR/report.txt"
curl -s -o "$OUTPUT_DIR/api-test.json" -w "%{http_code}" \
  -X GET "https://track.customer.io/api/v1/accounts" \
  -u "$CUSTOMERIO_SITE_ID:$CUSTOMERIO_API_KEY" \
  >> "$OUTPUT_DIR/report.txt"
echo "" >> "$OUTPUT_DIR/report.txt"

# 2. SDK Version
echo "=== SDK Version ===" >> "$OUTPUT_DIR/report.txt"
npm list @customerio/track 2>/dev/null >> "$OUTPUT_DIR/report.txt" || echo "Not using npm" >> "$OUTPUT_DIR/report.txt"
pip show customerio 2>/dev/null >> "$OUTPUT_DIR/report.txt" || echo "Not using pip" >> "$OUTPUT_DIR/report.txt"
echo "" >> "$OUTPUT_DIR/report.txt"

# 3. Environment (redacted)
echo "=== Environment ===" >> "$OUTPUT_DIR/report.txt"
echo "CUSTOMERIO_SITE_ID: ${CUSTOMERIO_SITE_ID:0:8}..." >> "$OUTPUT_DIR/report.txt"
echo "CUSTOMERIO_API_KEY: ${CUSTOMERIO_API_KEY:0:8}..." >> "$OUTPUT_DIR/report.txt"
echo "NODE_ENV: $NODE_ENV" >> "$OUTPUT_DIR/report.txt"
echo "" >> "$OUTPUT_DIR/report.txt"

echo "Debug bundle created: $OUTPUT_DIR"
```

### Step 2: Collect User-Specific Data
```typescript
// scripts/debug-user.ts
import { TrackClient, RegionUS } from '@customerio/track';

async function debugUser(userId: string) {
  const debug: Record<string, any> = {
    timestamp: new Date().toISOString(),
    userId,
    checks: {}
  };

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

  // Test identify call
  try {
    await client.identify(userId, { _debug_check: true });
    debug.checks.identify = { status: 'success' };
  } catch (error: any) {
    debug.checks.identify = {
      status: 'failed',
      error: error.message,
      code: error.statusCode
    };
  }

  // Test track call
  try {
    await client.track(userId, {
      name: '_debug_event',
      data: { timestamp: Date.now() }
    });
    debug.checks.track = { status: 'success' };
  } catch (error: any) {
    debug.checks.track = {
      status: 'failed',
      error: error.message,
      code: error.statusCode
    };
  }

  console.log(JSON.stringify(debug, null, 2));
  return debug;
}

// Run with: npx ts-node scripts/debug-user.ts user-123
debugUser(process.argv[2] || 'debug-user');
```

### Step 3: Collect Application Logs
```typescript
// lib/customerio-logger.ts
import { createWriteStream } from 'fs';

class CustomerIOLogger {
  private logStream: NodeJS.WritableStream;

  constructor(logPath: string = './customerio-debug.log') {
    this.logStream = createWriteStream(logPath, { flags: 'a' });
  }

  log(event: {
    type: 'identify' | 'track' | 'error';
    userId?: string;
    data?: any;
    error?: any;
    duration?: number;
  }) {
    const logEntry = {
      timestamp: new Date().toISOString(),
      ...event
    };
    this.logStream.write(JSON.stringify(logEntry) + '\n');
  }

  // Wrap SDK calls with logging
  async wrapIdentify(
    client: TrackClient,
    userId: string,
    attributes: any
  ) {
    const start = Date.now();
    try {
      await client.identify(userId, attributes);
      this.log({
        type: 'identify',
        userId,
        data: attributes,
        duration: Date.now() - start
      });
    } catch (error: any) {
      this.log({
        type: 'error',
        userId,
        data: attributes,
        error: { message: error.message, code: error.statusCode },
        duration: Date.now() - start
      });
      throw error;
    }
  }
}
```

### Step 4: Generate Support Report
```typescript
// scripts/generate-support-report.ts
interface SupportReport {
  summary: string;
  environment: {
    sdkVersion: string;
    nodeVersion: string;
    region: string;
  };
  timeline: Array<{
    timestamp: string;
    event: string;
    details: string;
  }>;
  reproduction: {
    steps: string[];
    expected: string;
    actual: string;
  };
  evidence: {
    logs: string[];
    screenshots: string[];
    apiResponses: string[];
  };
}

function generateReport(): SupportReport {
  return {
    summary: 'Brief description of the issue',
    environment: {
      sdkVersion: require('@customerio/track/package.json').version,
      nodeVersion: process.version,
      region: process.env.CUSTOMERIO_REGION || 'us'
    },
    timeline: [
      { timestamp: '2024-01-15T10:00:00Z', event: 'First occurrence', details: '...' }
    ],
    reproduction: {
      steps: [
        '1. Call identify with user data',
        '2. Call track with event',
        '3. Check dashboard for user'
      ],
      expected: 'User appears in People section',
      actual: 'User not found, 401 error returned'
    },
    evidence: {
      logs: ['./customerio-debug.log'],
      screenshots: [],
      apiResponses: ['./debug-bundle/api-test.json']
    }
  };
}
```

### Step 5: Bundle and Submit
```bash
#!/bin/bash
# Create debug bundle archive
DEBUG_DIR="customerio-debug-$(date +%Y%m%d-%H%M%S)"
mkdir -p "$DEBUG_DIR"

# Collect all debug files
cp customerio-debug.log "$DEBUG_DIR/" 2>/dev/null
cp -r debug-bundle/* "$DEBUG_DIR/" 2>/dev/null

# Redact sensitive data
sed -i 's/api_key=.*/api_key=REDACTED/g' "$DEBUG_DIR"/*.log 2>/dev/null
sed -i 's/"api_key":"[^"]*"/"api_key":"REDACTED"/g' "$DEBUG_DIR"/*.json 2>/dev/null

# Create archive
tar -czf "$DEBUG_DIR.tar.gz" "$DEBUG_DIR"
echo "Debug bundle ready: $DEBUG_DIR.tar.gz"
echo "Submit to: support@customer.io"
```

## Output
- Debug script for API testing
- User-specific diagnostic data
- Application log collection
- Support report template
- Compressed debug bundle

## Error Handling
| Issue | Solution |
|-------|----------|
| Logs too large | Use `tail -n 1000` to limit |
| Sensitive data | Use redaction script |
| Missing permissions | Check file read access |

## Resources
- [Customer.io Support](https://customer.io/contact/)
- [API Status](https://status.customer.io/)

## Next Steps
After creating debug bundle, proceed to `customerio-rate-limits` to understand API limits.


---
Source attribution: Dicklesworthstone
Original project: https://github.com/Dicklesworthstone/pi_agent_rust/blob/f28fc46ee0db8e710d95b8b55592cd38d60f2b26/tests/ext_conformance/artifacts/plugins-community/plugins/saas-packs/customerio-pack/skills/customerio-debug-bundle/SKILL.md
License: MIT
License information: https://opensource.org/license/mit
Original upstream instructions; downloaded from Mega AI Hub.

## Upstream license notice

MIT License (with OpenAI/Anthropic Rider)

Copyright (c) 2026 Jeffrey Emanuel

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

ADDITIONAL RIDER / RESTRICTION (OpenAI / Anthropic):

This rider is part of the "conditions" of this License. In the event of any
conflict between this rider and any other portion of this License, this rider
controls.

"Restricted Parties" means OpenAI, L.L.C.; Anthropic, PBC; any of their
respective Affiliates; and any person or entity acting directly or indirectly
on behalf of, for the benefit of, or under the direction of any of the
foregoing (including any officer, director, employee, contractor, agent,
consultant, service provider, or representative).

Notwithstanding any other provision of this License, no rights are granted to
any Restricted Party. Any purported license, sublicense, assignment, transfer,
or other permission to any Restricted Party is null and void absent the
express prior written permission of Jeffrey Emanuel.

You may not provide, disclose, distribute, sublicense, sell, lease, lend,
host, make available, or otherwise permit access to the Software or any
derivative work of the Software (as defined in applicable copyright law)
(collectively, "Derivative Works") to or for any Restricted Party.

For purposes of this rider, "use" includes, without limitation: copying,
modifying, merging, publishing, distributing, sublicensing, selling,
transferring, making available, hosting, deploying, executing, benchmarking,
testing, analyzing, indexing, or incorporating the Software or any Derivative
Works into any dataset, training corpus, evaluation harness, or pipeline for
machine learning or other automated systems.

This rider applies to the Software and all Derivative Works. As a condition of
use, you agree that this rider is a precondition to exercising any rights
under this License, and you agree that any distribution of the Software or any
Derivative Works must include this rider provision unmodified.

Any breach of this rider automatically and immediately terminates the
permissions granted by this License. Upon termination, you must immediately
cease all use and distribution of the Software and any Derivative Works and
destroy all copies under your control.

You agree that a breach of this rider would cause irreparable harm and that
Jeffrey Emanuel may seek injunctive or other equitable relief to enforce this
rider, in addition to any other remedies available at law. To the maximum
extent permitted by applicable law, the prevailing party in any action to
enforce this rider shall be entitled to recover reasonable attorneys' fees and
costs.

For purposes of this rider, "Affiliate" means any entity that directly or
indirectly controls, is controlled by, or is under common control with the
specified party. "Control" means ownership of more than 50% of the voting
securities or other ownership interest, or the power to direct management or
policies by contract or otherwise.

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.



# Mega AI Hub resource metadata

Creator / publisher: Dicklesworthstone
Original project: https://github.com/Dicklesworthstone/pi_agent_rust/blob/f28fc46ee0db8e710d95b8b55592cd38d60f2b26/tests/ext_conformance/artifacts/plugins-community/plugins/saas-packs/customerio-pack/skills/customerio-debug-bundle/SKILL.md
Attribution basis: Source repository record

Fields of work: Sales, Customer Support
Roles: Customer Success Manager, Support Agent, Technical Support
Specialties: API
Tools: Customer.Io
Country applicability: Country not specified
Classification basis: Source catalog labels
Instruction SHA-256: b6ac9bbffba8fdf476afe4e73da24eafa7129d4680cb1348b4fd5719f1509056
