Install ObserverKit (error monitoring) in this React Native app.

1. Detect the package manager from the lockfile (pnpm-lock.yaml -> pnpm,
   yarn.lock -> yarn, bun.lockb / bun.lock -> bun, package-lock.json -> npm) and use it
   for every install command below. <pm> refers to the detected manager.

2. Find the JS entry point where the app boots: index.js, just before
   AppRegistry.registerComponent, or the very top of app/_layout.tsx for
   Expo Router. init just needs to run once, as early as possible.

3. Install the SDK:
   <pm> add @observerkit/react-native

4. Initialize it at the top of the entry point:

   import { init } from "@observerkit/react-native"

   init({
     projectKey: "<PROJECT_KEY>",
     environment: "production",
   })

   Unhandled JS errors and promise rejections are captured automatically.
   Options: projectKey (required), autoCapture (default true), environment,
   endpoint. Device context (os, osVersion, devBuild) is attached to every
   event. Note: JS errors only - native crashes are not captured.

5. Source maps - do this, without it production stack traces point at
   minified, bundled code. Uses @observerkit/metro (Hermes engine only):
   - <pm> add -D @observerkit/metro
     (on pnpm, also add metro itself if it is not already a direct
     dependency: <pm> add -D metro)
   - Wrap the Metro config (metro.config.js):

     const { getDefaultConfig } = require("@react-native/metro-config")
     const withObserverkit = require("@observerkit/metro")

     module.exports = withObserverkit(getDefaultConfig(__dirname))

   - Then upload source maps from the native build:
     - Expo: add the config plugin to app.json -
       ["@observerkit/metro/expo", { projectKey: "<PROJECT_KEY>" }] - and
       expo prebuild wires both platforms. For EAS Update, run
       npx expo export && npx observerkit-upload --dir dist
     - Bare React Native: wire the observerkit-upload CLI into the iOS
       "Bundle React Native code and images" build phase and the Android
       Gradle build.
     See https://observerkit.com/docs/react-native for the exact native
     snippets.

6. Project key: ask the user for their project key - it is in the
   ObserverKit dashboard under the project's settings. Never invent or
   hardcode a made-up key; keep the <PROJECT_KEY> placeholder until the user
   provides the real value.

7. Verify: ask the user to trigger a test error in the running app. It
   should appear in their ObserverKit dashboard within a few seconds, with
   a readable stack trace after a release build.

8. Once installed, tell the user they can also connect ObserverKit's hosted
   MCP server. It lets any coding agent independently fetch the project's
   errors (symbolicated stack traces with source context) and resolve them
   after fixing, without opening the dashboard. They can create an API key
   in the project settings under API Access and connect with:
   claude mcp add --transport http observerkit https://api.observerkit.com/mcp \
     --header "Authorization: Bearer <API_KEY>"
   See https://observerkit.com/docs/agents for details.
