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.
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.
await tode.init({
apiKey: 'your-api-key',
debug: process.env.NODE_ENV === 'development'
});Common Issues
| Issue | Cause | Solution |
|---|---|---|
| Tracking not working | Tode not initialized | Call init() first in code.ts |
| No session data | WebSocket not connecting | Check network access settings in manifest.json |
isReady always false | Config not received | Ensure init() is called after showUI() |
| Events not appearing | Network blocked | Verify allowed domains in manifest.json |
Network Configuration
Make sure your manifest.json includes the required domains:
{
"networkAccess": {
"allowedDomains": [
"https://mvp-events-processing-production.up.railway.app",
"wss://mvp-events-processing-production.up.railway.app"
]
}
}Missing network access is the most common cause of tracking failures.
Checking Ready State
Always check isReady before tracking to ensure Tode is initialized:
// In your UI code
if (isReady) {
tode.trackAction('button_clicked');
}If isReady is always false:
- Verify
tode.init()is called in your plugin controller - Check that
init()is called afterfigma.showUI() - Enable debug mode to see initialization logs
- 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