What is @react-native-firebase/crashlytics?
@react-native-firebase/crashlytics is a React Native library that provides integration with Firebase Crashlytics, a real-time crash reporting tool. It helps developers track, prioritize, and fix stability issues that erode app quality, in real-time.
What are @react-native-firebase/crashlytics's main functionalities?
Crash Reporting
This feature allows you to report crashes to Firebase Crashlytics. The code sample demonstrates how to force a crash for testing purposes.
import crashlytics from '@react-native-firebase/crashlytics';
// Force a crash for testing purposes
crashlytics().crash();
Log Custom Events
This feature allows you to log custom events that can help you understand the sequence of actions leading up to a crash. The code sample shows how to log a custom event.
import crashlytics from '@react-native-firebase/crashlytics';
// Log a custom event
crashlytics().log('User clicked on the purchase button');
Set User Identifiers
This feature allows you to set user identifiers to help you understand which users are affected by crashes. The code sample demonstrates how to set a user identifier.
import crashlytics from '@react-native-firebase/crashlytics';
// Set user identifier
crashlytics().setUserId('12345');
Set Custom Keys
This feature allows you to set custom keys to provide additional context about the crash. The code sample shows how to set a custom key.
import crashlytics from '@react-native-firebase/crashlytics';
// Set custom keys
crashlytics().setAttribute('role', 'admin');
Record Non-Fatal Errors
This feature allows you to record non-fatal errors that do not crash the app but are still important to track. The code sample demonstrates how to record a non-fatal error.
import crashlytics from '@react-native-firebase/crashlytics';
// Record a non-fatal error
try {
throw new Error('Test non-fatal error');
} catch (error) {
crashlytics().recordError(error);
}
Other packages similar to @react-native-firebase/crashlytics
bugsnag-react-native
Bugsnag provides real-time error monitoring and crash reporting for mobile apps. It offers similar functionalities to Firebase Crashlytics, such as automatic crash reporting, custom event logging, and user identification. Bugsnag also provides additional features like session tracking and breadcrumb logging.
instabug-reactnative
Instabug provides in-app feedback and bug reporting for mobile apps. It offers crash reporting, user feedback, and detailed bug reports with screenshots and device logs. Instabug is more focused on user feedback and bug reporting compared to Firebase Crashlytics, which is primarily focused on crash reporting.
React Native Firebase - Crashlytics
This is for the upcoming v6.0.0 release of React Native Firebase, please use the react-native-firebase package instead, unless you're early adopting/testing the new packages - in which case please use the latest alpha/beta/next tag release on npm and not the latest
tagged release for this package.
Firebase Crashlytics helps you track, prioritize, and fix stability issues that erode app quality, in realtime. Spend less time triaging and troubleshooting crashes and more time building app features that delight users.
> Learn More
Installation
Requires @react-native-firebase/app
to be installed.
yarn add @react-native-firebase/crashlytics
react-native link @react-native-firebase/crashlytics
Documentation
License
Built and maintained with 💛 by Invertase.