@reliqo/react-native
v1.1.0
Published
Reliqo AI SDK for React Native: JavaScript errors (fatal and non-fatal), unhandled promise rejections, breadcrumbs and timings.
Maintainers
Readme
@reliqo/react-native
Reliqo AI SDK for React Native (0.70+, Hermes or JSC, iOS and Android): JavaScript errors — fatal and non-fatal — and
unhandled promise rejections, with breadcrumbs and timings. Pure JavaScript: no native module, no pod install.
Install
npm install @reliqo/react-native// index.js (before AppRegistry.registerComponent)
import * as Reliqo from '@reliqo/react-native';
Reliqo.init({
dsn: 'https://<project key>@reliqo.example.com/<project id>', // Settings → DSN in Reliqo
environment: __DEV__ ? 'development' : 'production',
release: '[email protected]',
dist: '42', // build number
});The DSN key is an ingest-only project key (it can send events, not read data), so it may be shipped in the app.
Use
Reliqo.captureException(err, { tags: { screen: 'Checkout' } });
Reliqo.setUser({ id: 'u_123' });
const t = Reliqo.startTransaction('ProfileScreen', 'screen'); /* … */ t.finish();
Reliqo.recordPerformance('startup_time', 1200); // a measured duration in msFatal JavaScript errors are flushed (up to 2 s) before React Native's own handler runs, so the red box in development and the normal crash in release builds are unchanged.
Options: as @reliqo/browser (dsn, environment, release, dist, sampleRate, ignoreErrors, beforeSend,
tags, user, maxBreadcrumbs, timeoutMs, maxRetries, maxQueueSize, enabled, debug), plus autoCapture
(default true).
Not included
Native crashes (Java/Kotlin, Objective-C/Swift, NDK) are not captured. The 1.x package
(@rezabakhshi/error-tracker-react-native) advertised native crash capture, but its native code was never linked
(no podspec, no autolinking config), so it never worked; it was removed rather than shipped broken. For native crashes, the
Android and iOS SDKs in the Reliqo repository (sdk/android, sdk/ios, not yet published to Maven / Swift Package
Index) can be added to the native projects. Source maps / symbolication are not part of this release.
Migrate from @rezabakhshi/error-tracker-react-native
npm uninstall @rezabakhshi/error-tracker-react-native && npm install @reliqo/react-native. initReactNative still
works (alias of init); apiKey is optional (taken from the DSN). Remove calls to captureNativeCrashes,
getMemoryInfo, getStartupTime.
Uninstall
Remove the init call, then npm uninstall @reliqo/react-native.
