Configuration Options
The Solute SDK can be configured with a variety of options to customize its behavior.Basic Configuration
Configuration Reference
Required Options
string
required
Your Solute API key. Get this from your Solute dashboard.
Optional Options
string
default:"https://api.solute.dev"
The API host URL. Defaults to
https://api.solute.dev.boolean
default:"false"
Enable debug logging. Useful for development. Logs all events and API calls to the console.
boolean
default:"false"
Disable the SDK entirely. All methods will be no-ops. Useful for testing or feature flags.
boolean
default:"true"
Automatically track page views on route changes (browser only).
boolean
default:"true"
Capture a page view event when the SDK initializes.
boolean
default:"true"
Capture personally identifiable information (PII) in events. Set to
false for GDPR compliance.number
default:"1800000"
Session timeout in milliseconds. Defaults to 30 minutes (1800000ms). A new session is created after this period of inactivity.
string
Pre-set the user ID. Useful if you already know the user ID at initialization time.
string
Pre-set the anonymous ID. Usually auto-generated, but can be set for consistency.
(error: Error) => void
Error handler callback. Called when errors occur during event tracking or API calls.
Storage Configuration
'localStorage' | 'cookie' | 'memory'
default:"'localStorage'"
Storage backend to use.
localStorage for browser, cookie for cross-domain tracking, memory for server-side or testing.string
default:"'solute_'"
Prefix for all storage keys. Useful to avoid conflicts with other libraries.
Queue Configuration
number
default:"1000"
Maximum number of events to queue before dropping old events. Prevents memory issues.
number
default:"10000"
Automatic flush interval in milliseconds. Events are sent to the API every N milliseconds. Defaults to 10 seconds.
number
default:"20"
Number of events to accumulate before automatically flushing. Events are sent when this many events are queued.
number
default:"100"
Maximum number of events to send in a single batch request.
Feature Flags Configuration
boolean
default:"true"
Enable feature flags and A/B testing functionality.
number
default:"300000"
Feature flags refresh interval in milliseconds. Defaults to 5 minutes (300000ms).
boolean
default:"true"
Automatically track exposure events when feature flags are evaluated.
HTTP Configuration
number
default:"10000"
Request timeout in milliseconds. Defaults to 10 seconds.
number
default:"3"
Maximum number of retry attempts for failed requests.
number
default:"1000"
Initial retry delay in milliseconds. Uses exponential backoff.
Record<string, string>
Additional HTTP headers to include in all requests.
Complete Example
Next Steps
Event Tracking
Learn how to track events
Feature Flags
Set up feature flags
