Skills Development Anima Debug Bundle Generator

Anima Debug Bundle Generator

v20260423
anima-debug-bundle
This utility generates a comprehensive JSON debug bundle for troubleshooting and support requests related to the Anima SDK. It collects vital information, including environment details, Figma API connectivity status, and verifies the Anima SDK generation capabilities. Use it when filing support tickets or debugging code generation issues.
Get Skill
56 downloads
Overview

Anima Debug Bundle

Instructions

Step 1: Generate Debug Bundle

// src/debug/anima-debug.ts
import fs from 'fs';

async function generateDebugBundle() {
  const bundle = {
    timestamp: new Date().toISOString(),
    environment: {
      nodeVersion: process.version,
      sdkVersion: require('@animaapp/anima-sdk/package.json').version,
      animaToken: process.env.ANIMA_TOKEN ? 'SET (redacted)' : 'NOT SET',
      figmaToken: process.env.FIGMA_TOKEN ? 'SET (redacted)' : 'NOT SET',
    },
    figmaAccess: await testFigmaAccess(),
    generationTest: await testGeneration(),
  };

  const filename = `anima-debug-${Date.now()}.json`;
  fs.writeFileSync(filename, JSON.stringify(bundle, null, 2));
  console.log(`Debug bundle: ${filename}`);
  return bundle;
}

async function testFigmaAccess() {
  try {
    const res = await fetch('https://api.figma.com/v1/me', {
      headers: { 'X-Figma-Token': process.env.FIGMA_TOKEN! },
    });
    const data = await res.json();
    return { status: res.ok ? 'ok' : 'failed', user: data.handle || data.err };
  } catch (err: any) {
    return { status: 'failed', error: err.message };
  }
}

async function testGeneration() {
  try {
    const { Anima } = await import('@animaapp/anima-sdk');
    const anima = new Anima({ auth: { token: process.env.ANIMA_TOKEN! } });
    return { status: 'sdk_loaded', version: 'check package.json' };
  } catch (err: any) {
    return { status: 'sdk_failed', error: err.message };
  }
}

generateDebugBundle().catch(console.error);

Output

  • JSON debug bundle with SDK version, token status, and connectivity test
  • Figma API access verification
  • Safe for sharing with Anima support (tokens redacted)

Resources

Next Steps

For rate limiting, see anima-rate-limits.

Info
Category Development
Name anima-debug-bundle
Version v20260423
Size 2.41KB
Updated At 2026-04-26
Language