Skip to main content

Troubleshooting

Common issues and how to resolve them.

Feature Flag Not Working​

Check Feature Flag Status​

  1. Navigate to the feature flag in dashboard
  2. Verify it's enabled
  3. Check targeting rules
  4. Verify environment

Check SDK Configuration​

// Verify API keys are correct
console.log('App Key:', process.env.TOGGLY_APP_KEY);
console.log('Environment:', process.env.TOGGLY_ENVIRONMENT);

// Verify SDK initialization
const toggly = new TogglyClient({
appKey: process.env.TOGGLY_APP_KEY,
environment: process.env.TOGGLY_ENVIRONMENT
});

Check User Context​

// Verify user context is being passed
const context = {
userId: 'user-123',
traits: {
plan: 'premium'
}
};

console.log('Context:', context);
const result = await toggly.evaluateFeature('my-feature', context);

API Errors​

401 Unauthorized​

  • Cause: Invalid or missing Bearer token, expired token, or invalidated token
  • Solution:
    • Verify Bearer token is correct and included in requests
    • Check if your access token has expired (refresh it)
    • If you recently signed out, obtain a new token by signing in again
    • Ensure the token hasn't been invalidated via logout

403 Forbidden​

  • Cause: Insufficient permissions for the requested resource
  • Solution:
    • Verify your user account has the necessary permissions
    • Check team membership and roles
    • Contact your workspace administrator

429 Too Many Requests​

  • Cause: Rate limit exceeded
  • Solution: Implement caching or reduce request frequency

500 Internal Server Error​

  • Cause: Server error
  • Solution: Retry request, check status page

Authentication Issues​

Token Already Invalidated​

If you receive "Token has been invalidated" errors:

  1. Sign out completely from all devices
  2. Clear browser cache and extension storage
  3. Sign in again to obtain a new token
  4. Verify logout process - ensure you're using the official sign out button

Token Not Invalidating on Logout​

If your token is not being invalidated when you sign out:

  1. Check network connectivity - the invalidation request requires internet
  2. Verify API endpoint - ensure the invalidation endpoint is accessible
  3. Check browser console for errors during logout
  4. Try signing out from the web interface instead of the extension

Chrome Extension specific:

  • Open Chrome DevTools (F12)
  • Navigate to the Console tab
  • Look for messages starting with [AuthService]
  • Check for any errors during the logout process

"No bearer token provided" Error​

If you see this error when trying to invalidate a token:

  • Cause: Authorization header is missing or malformed
  • Solution: Ensure your request includes Authorization: Bearer YOUR_TOKEN

Token Still Working After Logout​

If API requests succeed with a token that should be invalidated:

  1. Verify logout completed - check the logout API response
  2. Check token expiration - the token may have already expired naturally
  3. Clear all local storage - remnants may cause confusion
  4. Contact support if the issue persists

To verify token invalidation:

# Try using the token after logout
curl -H "Authorization: Bearer YOUR_OLD_TOKEN" \
https://app.toggly.io/api/v2/applications

# Expected response: 401 Unauthorized

Chrome Extension Authentication Issues​

Extension not loading user data:

  1. Open extension popup
  2. Click "Sign Out"
  3. Close and reopen the extension
  4. Sign in again
  5. Verify user information loads

Extension showing "Not authenticated":

  • Check if you're signed in at app.toggly.io
  • Verify extension has necessary permissions
  • Try reinstalling the extension
  • Clear extension storage: Chrome → Settings → Privacy → Site Settings → Storage → chrome-extension://toggly

Token refresh failing:

  • Check internet connectivity
  • Verify auth.toggly.io is accessible
  • Try signing out and back in
  • Check browser console for detailed error messages

Performance Issues​

Web App (PWA) Issues​

iOS Safari / iPhone: stuck in a refresh loop or blank page​

This is usually caused by a stale or corrupted service worker cache. Use the recovery page below (it will unregister service workers, clear cache storage, and reload):

Slow Evaluations​

  • Enable Caching: Use SDK caching
  • Reduce API Calls: Batch evaluations when possible
  • Check Network: Verify network connectivity

High Latency​

  • Use CDN: Ensure using CDN endpoints
  • Enable Caching: Cache feature flags locally
  • Optimize Context: Reduce context data size

Best Practices​

  1. Enable Logging: Enable SDK logging for debugging
  2. Monitor Metrics: Watch error rates and latency
  3. Test Locally: Test in development environment first
  4. Check Documentation: Review SDK documentation

Getting Help​

  • Documentation: Check this documentation
  • Support: Contact [email protected]
  • Status Page: Check status.toggly.io
  • GitHub: Open an issue on GitHub

Next Steps​