Error Handling

Learn how to handle errors and debug issues in your Tode analytics implementation for Figma plugins and widgets.

Silent Failures by Design

Tode methods are designed to fail silently to avoid disrupting your plugin's functionality. This means:

  • Tracking calls won't throw errors that crash your UI
  • Users won't see error messages from analytics
  • Your plugin continues working even if analytics fail

Debug Mode

Enable debug mode during development to see what's happening under the hood. This logs all tracking calls and any errors to the console.

code.ts
import { tode } from '@tode-sdk/core';
 
await tode.init({
  apiKey: 'your-api-key',
  debug: true  // Enable for development
});

With debug mode enabled, you'll see console logs for:

  • Initialization status
  • Each tracking call
  • Connection state changes
  • Any errors that occur

Tip: Disable debug mode in production to keep the console clean for your users.

code.ts
await tode.init({
  apiKey: 'your-api-key',
  debug: process.env.NODE_ENV === 'development'
});

Common Issues

IssueCauseSolution
Tracking not workingTode not initializedCall init() first in code.ts
No session dataWebSocket not connectingCheck network access settings in manifest.json
isReady always falseConfig not receivedEnsure init() is called after showUI()
Events not appearingNetwork blockedVerify allowed domains in manifest.json
Console shows 429Monthly event quota used upCheck usage on the dashboard; upgrade or wait for the period to reset
Console shows 403 event_types_limit_reachedToo many distinct actionNamesRemove a type in plugin settings or upgrade (Plans and Limits)

Server Responses

Every tracking request answers with JSON. Success is 201 {"ok": true}. Errors carry an error code and a human-readable message:

StatuserrorMeaningWhat to do
400invalid_bodyA required field is missing or has the wrong type; message names itUpdate the SDK; the adapters always send a valid body
401api_key_requiredNo X-API-Key headerPass apiKey to init()
403invalid_api_keyUnknown or revoked keyCopy the key from the plugin settings; rotated keys stop working after 24 hours
403plugin_suspendedThe plugin exceeds the account's planUpgrade or archive other plugins
403event_types_limit_reachedNew actionName beyond the plan's cap; existing names still workRemove a type or upgrade
429events_limit_reachedMonthly quota used upUpgrade or wait for the reset
429rate_limitedMore than 600 requests per minute from one keyDebounce bursts; Retry-After says when

The SDK logs these to the console and continues; your plugin never sees an exception.


Network Configuration

Make sure your manifest.json includes the required domains:

manifest.json
{
  "networkAccess": {
    "allowedDomains": [
      "https://processing.usetode.dev",
      "wss://processing.usetode.dev"
    ]
  }
}

Missing network access is the most common cause of tracking failures.


Checking Ready State

Always check isReady before tracking to ensure Tode is initialized:

TypeScript
// In your UI code
if (isReady) {
  tode.trackAction('button_clicked');
}

If isReady is always false:

  1. Verify tode.init() is called in your plugin controller
  2. Check that init() is called after figma.showUI()
  3. Enable debug mode to see initialization logs
  4. Verify network access is configured correctly

Getting Help

If you're still experiencing issues:

  • Review the Best Practices for correct implementation patterns
  • Check your framework guide for specific setup instructions
  • Enable debug mode and check browser console for errors
  • Contact support with your debug logs

Track your Figma plugin

Sign up to get your API key and start collecting analytics in minutes.

Get your API key