Best Practices#
1.
Refresh tokens before they expire (within 5 minutes of expiration)
Store tokens securely (httpOnly cookies or secure storage)
Clear tokens immediately on logout
Never log tokens in console or error messages
2.
Use pagination for large datasets
Implement caching for frequently accessed data
Use appropriate HTTP methods (GET, POST, PUT, DELETE)
Include proper error handling and retries
3.
Batch requests when possible
Use query parameters for filtering instead of client-side filtering
Implement request debouncing for search operations
Cache static data (industries, ad sources, tags)
4.
Always use HTTPS in production
Validate and sanitize user input
Implement CORS restrictions
Monitor for suspicious activity
5.
Log all API errors with request IDs
Monitor token refresh failures
Set up alerts for 5xx errors
Modified at 2026-03-23 17:19:55