debug-api

Diagnose HTTP/network/API failures in the mParticle Web SDK by analyzing requests and responses.

24|59|Updated Aug 28, 2015
One-click install
npx skills add https://github.com/mParticle/mparticle-web-sdk --skill debug-api
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: debug-api
Source: https://github.com/mParticle/mparticle-web-sdk/tree/main/.claude/skills/debug-api
Command: npx skills add https://github.com/mParticle/mparticle-web-sdk --skill debug-api

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Diagnose HTTP/network/API failures in the mParticle Web SDK by systematically inspecting requests, responses, and API client state to identify root causes.

Core Features & Use Cases

  • Network request/response inspection across Events, Identity, and Config APIs to identify failure modes and misconfigurations.
  • Deterministic logging of API client state in src/apiClient.ts, identityApiClient.ts, and src/configAPIClient.ts, and guidance to reproduce issues.
  • Guided investigation flow covering common root causes: authentication, endpoint correctness, DTO contract drift, and batch upload timing.

Quick Start

Reproduce the issue in the browser and start by opening the Network tab to inspect requests to /v1/[workspace]/events, /v1/[workspace]/identify, and /v1/[workspace]/config to pinpoint the failing step.

Frequently Asked Questions about debug-api

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I diagnose HTTP network failures in the mParticle Web SDK?

Diagnose mParticle Web SDK HTTP network failures by reproducing the issue in the browser and inspecting Network tab requests to /v1/[workspace]/events, /identify, and /config endpoints to pinpoint the failing step and identify misconfigurations.

What causes API contract drift and authentication issues in Web SDK identity flows?

API contract drift and authentication issues in Web SDK identity flows stem from incorrect workspace IDs, mismatched response DTO structures, and endpoint path errors. Log client state in identityApiClient.ts to verify configurations against expected responses.

Can I use this diagnostic approach for staging environment API client debugging?

Yes, this diagnostic approach applies to staging environment API client debugging. It inspects requests, responses, and API client state across Events, Identity, and Config APIs to identify failure modes and misconfigurations in development and staging.

Why does fetch-mock differ from real endpoints when debugging Web SDK API requests?

Fetch-mock differs from real endpoints because mock configurations often lack exact response DTO structures and authentication behaviors. Verify endpoint paths, workspace IDs, and batch upload timing in apiClient.ts to reconcile mock and live API differences.

What's the best way to troubleshoot batch upload timing and config API failures?

Troubleshoot batch upload timing and config API failures by enabling deterministic logging in configAPIClient.ts and apiClient.ts. Inspect the Network tab for /v1/[workspace]/config requests and verify response DTO structures and endpoint correctness.

Do I need to log API client state in src/apiClient.ts to reproduce SDK issues?

Yes, logging API client state in apiClient.ts, identityApiClient.ts, and configAPIClient.ts is required. Deterministic logging provides the API client behavior context needed to reproduce issues and identify root causes across Events, Identity, and Config flows.