# Best Practices

1. **Use Long-Lived Tokens** - They last 60 days instead of 1 hour
2. **Refresh Tokens Regularly** - Refresh before expiration
3. **Handle Errors Gracefully** - Always wrap API calls in try-catch
4. **Respect Rate Limits** - Implement exponential backoff
5. **Use Webhooks** - Set up webhooks for real-time updates
6. **Cache Data** - Cache insights and media to reduce API calls
7. **Validate Media URLs** - Ensure URLs are publicly accessible
8. **Test Thoroughly** - Test in sandbox mode before production