Mobile SDKs
React Native SDK
Integrate Instalog into your React Native applications
Installation
Usage
Initialization
Initialize Instalog at the beginning of your app, typically in your main App file:
Platform-specific Setup
Android
For feedback functionality on Android, ensure you have the Instalog activity registered in your AndroidManifest.xml:
User Identification
Identify your users to associate logged events and crashes with specific users:
Event Logging
Log specific events with optional properties:
Error Boundary
Use the ErrorBoundary component to catch and report React component errors:
Manual Error Reporting
Send manual error reports:
User Feedback
Show a feedback modal to collect user feedback:
Test/Debug Methods
Advanced Configuration
Error Grouping
Instalog can group similar errors together to reduce noise in your error reports:
Common Issues
-
SDK Not Initialized
- Make sure to await the
initialize
call - Verify your API key is correct
- Make sure to await the
-
Missing Error Reports
- Check that
isCrashEnabled
is set to true - Verify network connectivity
- Check that
-
Error Boundary Not Working
- Ensure the ErrorBoundary is placed correctly in your component tree
- Check that you’ve provided a fallback component
For additional support, please contact [email protected].
API Reference
Instalog
Method | Description |
---|---|
initialize(apiKey, options) | Initializes the Instalog SDK with API key and options |
identifyUser(userId) | Sets the user ID for tracking |
log(event, properties) | Logs an event with optional properties |
sendCrash(name, report) | Manually sends a crash report |
showFeedbackModal() | Shows the feedback collection UI |
simulateCrash() | Simulates a crash for testing |
formatErrorReport(error, errorInfo) | Formats an error into a structured report |
ErrorBoundary | React component to catch and report rendering errors |
Options
Option | Type | Default | Description |
---|---|---|---|
isCrashEnabled | boolean | false | Enable crash reporting |
isFeedbackEnabled | boolean | false | Enable user feedback collection |
isLogEnabled | boolean | false | Enable event logging |
isLoggerEnabled | boolean | false | Enable console logging |
autoCaptureCrashes | boolean | false | Automatically capture unhandled JS errors |
errorGrouping | object | See above | Configuration for error grouping behavior |