Getting started — React Native
React Native quickstart
Section titled “React Native quickstart”Goal: 5 minutes from bun add @goliapkg/sentori-react-native to a
mobile error showing up in the Sentori dashboard.
Prerequisites
Section titled “Prerequisites”- A React Native app, Expo or bare. Expo Go does not bundle native
modules so iOS dSYM uploads / Android ANR detection require a
custom dev client (
expo prebuild) or a bare RN project. - Xcode (macOS) or Android Studio if you need native debugging.
- A Sentori token and ingest URL — see the React quickstart §Prerequisites.
1. Install
Section titled “1. Install”bun add @goliapkg/sentori-react-native# orpnpm add @goliapkg/sentori-react-native
# Expo: also rebuild the native layer once.bunx expo prebuild --clean2. Configure & initialise
Section titled “2. Configure & initialise”Initialise once before any other module that might throw. The
recommended spot is the very top of your entry file (index.js for
bare RN, app/_layout.tsx for Expo Router):
// index.js (bare RN) or app/_layout.tsx (Expo Router)import 'react-native-gesture-handler' // any existing top importsimport { sentori } from '@goliapkg/sentori-react-native'
sentori.init({ token: 'st_pk_...', release: 'myapp@1.0.0+123', // your build number / commit environment: __DEV__ ? 'dev' : 'prod', ingestUrl: 'https://ingest.sentori.golia.jp',})
// ... rest of your entryThe init call:
- installs JS global error / unhandledRejection hooks
- attaches a native crash handler (signal-style on iOS, Java exception handler on Android)
- starts the hang watchdog (iOS) / ANR detector (Android)
3. Capture your first error
Section titled “3. Capture your first error”import { Button, View } from 'react-native'import { sentori } from '@goliapkg/sentori-react-native'
export default function Home() { return ( <View> <Button onPress={() => { throw new TypeError('hello sentori') }} title="Boom" /> <Button onPress={() => sentori.captureException(new Error('manual capture'), { tags: { feature: 'checkout' }, }) } title="Capture manually" /> </View> )}Tap Boom to trigger a render-phase throw; tap Capture manually for an imperative report.
4. View on the dashboard
Section titled “4. View on the dashboard”Open your dashboard. The new issue appears within a few seconds on the Issues list.
If you don’t see it:
- iOS sim: events go through the host’s network —
localhost:8080on the sim is the host’slocalhost. - Android emulator: replace
localhostwith10.0.2.2so the emulator can reach your dev machine. Or use the LAN IP. - Inspect Metro / native logs for
[sentori]warnings — bad tokens, network failures, and HTTP 4xx all log there.
5. Source maps + native symbols (optional but recommended)
Section titled “5. Source maps + native symbols (optional but recommended)”JS errors symbolicate from the bundle source map; iOS / Android crashes from the dSYM / proguard mapping respectively. Upload after each build:
# JS bundle mapsentori-cli upload sourcemap \ --release "myapp@1.0.0+123" \ --token "$SENTORI_TOKEN" \ --ingest-url "$SENTORI_INGEST_URL" \ ios/main.jsbundle.map android/app/build/.../index.android.bundle.map
# iOS dSYMssentori-cli upload dsym \ --project "$PROJECT_ID" \ --release "myapp@1.0.0+123" \ --token "$SENTORI_ADMIN_TOKEN" \ --api-url "$SENTORI_API_URL" \ ios/build/.../dSYMs/
# Android Proguard mappingsentori-cli upload mapping \ --project "$PROJECT_ID" \ --release "myapp@1.0.0+123" \ --token "$SENTORI_ADMIN_TOKEN" \ --api-url "$SENTORI_API_URL" \ android/app/build/outputs/mapping/release/mapping.txt6. Next steps
Section titled “6. Next steps”- SDK reference —
<ErrorBoundary>, breadcrumbs, navigation hook, hang/ANR detection knobs - Self-hosting — production deploy, SMTP
- Protocol — wire format reference