Troubleshooting
Common issues and how to resolve them.
Feature Flag Not Working
Check Feature Flag Status
- Navigate to the feature flag in dashboard
- Verify it's enabled
- Check targeting rules
- 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:
- Sign out completely from all devices
- Clear browser cache and extension storage
- Sign in again to obtain a new token
- 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:
- Check network connectivity - the invalidation request requires internet
- Verify API endpoint - ensure the invalidation endpoint is accessible
- Check browser console for errors during logout
- 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:
- Verify logout completed - check the logout API response
- Check token expiration - the token may have already expired naturally
- Clear all local storage - remnants may cause confusion
- 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:
- Open extension popup
- Click "Sign Out"
- Close and reopen the extension
- Sign in again
- 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):
- Reset App Cache:
https://app.toggly.io/pwa-reset?ngsw-bypass=true
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
- Enable Logging: Enable SDK logging for debugging
- Monitor Metrics: Watch error rates and latency
- Test Locally: Test in development environment first
- 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
- Learn about Status
- Explore Environments
- Read about Rate Limits