Advanced Configuration
Customize Bily’s behavior with advanced configuration options.Initialization Options
Event Queue & Retry Mechanism
The browser SDK includes a robust event queue system with persistence and retry capabilities:- Failed events are stored in localStorage
- Automatic retry with exponential backoff
- Events persist across page reloads
- Queued events are processed in order
Circuit Breaker Pattern
The SDK implements a circuit breaker pattern to handle failures gracefully:- Prevents overwhelming failed endpoints
- Automatically recovers after cooldown
- Implements half-open state for recovery
- Manages retry attempts intelligently
Custom Event Aliases
TypeScript Integration
Next.js Integration
Custom Client Data
Enhanced Validation
The SDK performs comprehensive validation of event payloads:Error Handling
The SDK includes multiple layers of error protection:- Input Validation
- Circuit Breaker & Queue
- Manual Error Handling (if needed)
Best Practices
- Use TypeScript for better type safety
- Enable verbose mode in development
- Enable persistQueue in production for reliability
- Handle validation errors appropriately
- Use environment variables for configuration
- Monitor circuit breaker status in verbose mode
- Test with invalid payloads in development
Next Steps
- Review Core Concepts
- Explore E-commerce Integration
- Check TypeScript Support