@bugspulse/react-native
v0.2.0
Published
Session replay, crash reporting, and network monitoring for React Native apps
Downloads
49
Maintainers
Readme
@bugspulse/react-native
Session replay, crash reporting, and network monitoring for React Native apps.
Installation
npm install @bugspulse/react-native
# or
yarn add @bugspulse/react-nativeQuick start
// index.js or App.tsx
import BugsPulse from '@bugspulse/react-native';
BugsPulse.init({
apiKey: 'bp_your_key_here', // from your project settings
environment: 'production',
});End a session
Call this when the app is backgrounded so session duration is recorded:
import { AppState } from 'react-native';
AppState.addEventListener('change', (state) => {
if (state === 'background') {
BugsPulse.endSession();
}
});Track custom events
BugsPulse.track('purchase_completed', { plan: 'pro', amount: 29 });Identify the user
BugsPulse.setUser('user_internal_id_123'); // never pass PIICapture exceptions manually
try {
await riskyOperation();
} catch (error) {
BugsPulse.captureException(error, { context: 'checkout_flow' });
throw error;
}Configuration
| Option | Type | Default | Description |
|--------|------|---------|-------------|
| apiKey | string | required | Your project API key |
| apiUrl | string | https://api.bugspulse.com | Custom endpoint for self-hosted |
| environment | string | 'production' | Tag sessions by environment |
| captureNetworkRequests | boolean | true | Intercept fetch calls |
| captureCrashes | boolean | true | Handle global JS errors |
| captureTouches | boolean | true | Record tap/swipe events |
| sessionSamplingRate | number | 1.0 | Fraction 0–1 of sessions to capture |
| flushIntervalMs | number | 5000 | How often to flush events |
| maxOfflineQueueSize | number | 1000 | Max events buffered offline |
| redactedFields | string[] | [] | Extra URL param keys to redact |
Privacy
- Keyboard input is never captured
- No video or screenshots
- Common sensitive fields (
authorization,token,password, etc.) are auto-redacted from network request URLs - Add custom fields via
redactedFields
License
MIT
