SDK Configuration
Customize WhatzBug SDK behavior with initialization options and feature flags.
Basic Initialization
App.tsxtypescript
import WhatzBug from '@whatzbug/react-native';
await WhatzBug.init({
projectId: 'your-project-id',
publishableKey: 'pk_your_key',
apiBaseUrl: 'https://api.whatzbug.com',
debug: true, // auto-connect to Desktop App
});The init() method is idempotent — calling it multiple times is safe and will be a no-op after the first successful init.
Configuration Options
| Option | Type | Default | Description |
|---|---|---|---|
projectId | string | Required | Project ID from your dashboard |
publishableKey | string | Required | Publishable API key |
apiBaseUrl | string | Required | Backend API URL |
debug | boolean | object | false | Auto-connect to WhatzBug Desktop for real-time debugging. Pass true or { host, port } |
flushIntervalMs | number | 5000 | Event batch flush interval (ms) |
maxQueueSize | number | 1000 | Max events before force-flush |
enableNetworkMonitoring | boolean | true | Auto-intercept XHR/fetch |
features | WhatzBugFeatures | All enabled | Feature opt-out flags |
Feature Opt-Out
Disable specific SDK features by setting them to false:
await WhatzBug.init({
projectId: 'your-project-id',
publishableKey: 'pk_your_key',
apiBaseUrl: 'https://api.whatzbug.com',
features: {
replay: true, // Session Replay
network: true, // Network monitoring
crashes: true, // Crash reporting
session: true, // Session management
journey: true, // Journey recording
performance: true, // Performance monitoring
},
});Safety Guarantees
No-Throw Safety
All WhatzBug SDK methods are wrapped in no-throw safety wrappers (noThrow() / safeAsync()). The SDK will never crash your app.