Overview
Follow these best practices to ensure your Sticker integration is secure, performant, and provides the best user experience.Authentication & Security
Protect Your API Key
Protect Your API Key
DO:
- Store API keys in environment variables
- Use secrets management systems (AWS Secrets Manager, HashiCorp Vault)
- Rotate keys regularly
- Use different keys for sandbox and production
- Hardcode API keys in source code
- Commit keys to version control
- Share keys in chat/email
- Expose keys in client-side code
Implement Request Signing Correctly
Implement Request Signing Correctly
DO:
- Sign the exact request body string (no modifications)
- Use constant-time comparison for signatures
- Generate fresh signatures for each request
- Log signature mismatches for debugging
- Modify request body after signing
- Cache signatures
- Use simple string comparison (timing attacks)
- Skip signature validation in development
Session Token Management
Session Token Management
DO:
- Generate tokens on-demand when user opens module
- Handle token expiration gracefully
- Regenerate tokens on authentication errors
- Clear tokens after user logs out
- Pre-generate tokens in advance
- Cache or store session tokens
- Reuse tokens across sessions
- Share tokens between users
iframe Security
iframe Security
DO:
- Use sandbox attribute with minimal permissions
- Verify postMessage origin strictly
- Implement Content Security Policy
- Use HTTPS for all environments
- Allow
allow-top-navigationunnecessarily - Trust messages from unknown origins
- Mix HTTP and HTTPS content
- Disable security features for convenience
Error Handling
Implement Retry Logic
Use exponential backoff for transient failures:Handle Rate Limiting
Respect rate limits and implement backoff:User-Friendly Error Messages
Transform technical errors into helpful messages:Performance Optimization
Cache Organization Data
Cache organization setup data to avoid redundant API calls:Preload iframe
Start loading the iframe while generating the session token:Monitor Performance
Track integration performance metrics:User Experience
Loading States
Always show loading indicators:Graceful Degradation
Provide fallback options when integration fails:Communicate Order Status
Keep users informed about their orders:Data Management
Sync Organization Data
Keep organization data in sync:Handle User Updates
Update user profiles when names change:Monitoring & Observability
Log All API Interactions
Maintain comprehensive logs:Set Up Alerts
Monitor critical metrics:Testing
Integration Tests
Test your integration thoroughly:Use Sandbox Environment
Always test in sandbox first:Deployment Checklist
Before going live, verify:1
Security
- API keys stored securely in environment variables
- Request signing implemented correctly
- iframe sandbox attributes configured
- CSP headers include Sticker domains
- HTTPS enabled on all pages
2
Error Handling
- Retry logic with exponential backoff
- Rate limiting handled gracefully
- User-friendly error messages
- Fallback UI for failures
- Error logging and monitoring
3
User Experience
- Loading states for all async operations
- Responsive design on mobile devices
- Accessible (screen reader compatible)
- Order completion notifications
- Clear navigation and CTAs
4
Performance
- iframe loads in < 3 seconds
- API calls complete in < 2 seconds
- No unnecessary re-renders
- Metrics tracking implemented
- Performance monitoring active
5
Testing
- All integration tests passing
- Tested in sandbox environment
- Manual QA completed
- Cross-browser testing done
- Mobile testing completed
Support & Maintenance
Stay Updated
- Subscribe to the Sticker changelog
- Join the partner community forum
- Attend quarterly partner webinars
- Review API deprecation notices

