@danieljvdm/dev-kit 1.0.2 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -6
- package/package.json +1 -1
- package/skill-sources.jsonc +2 -33
- package/skill-sources.lock.json +15 -117
- package/skills/animate/LICENSE +21 -0
- package/skills/animate/NOTICE +10 -0
- package/skills/animate/SKILL.md +34 -0
- package/skills/animate/references/gestures.md +27 -0
- package/skills/animate/references/glossary.md +136 -0
- package/skills/animate/references/implementation.md +22 -0
- package/skills/animate/references/opportunities.md +18 -0
- package/skills/animate/references/principles.md +48 -0
- package/skills/animate/references/review.md +19 -0
- package/skills/cloudflare-workers/LICENSE +202 -0
- package/skills/cloudflare-workers/NOTICE +9 -0
- package/skills/cloudflare-workers/SKILL.md +26 -0
- package/skills/cloudflare-workers/references/durable-objects.md +68 -0
- package/skills/cloudflare-workers/references/sandbox.md +48 -0
- package/skills/cloudflare-workers/references/workers.md +63 -0
- package/skills/cloudflare-workers/references/wrangler.md +56 -0
- package/skills/design-ui/LICENSE +21 -0
- package/skills/design-ui/NOTICE +8 -0
- package/skills/design-ui/SKILL.md +29 -0
- package/skills/design-ui/references/appearance.md +22 -0
- package/skills/design-ui/references/components.md +33 -0
- package/skills/design-ui/references/exploration.md +50 -0
- package/skills/design-ui/references/libraries.md +39 -0
- package/skills/design-ui/references/themes.md +23 -0
- package/skills/dev-kit/SKILL.md +19 -38
- package/skills/dev-kit/references/cloudflare-worker-api.md +1 -1
- package/skills/dev-kit/references/skills.md +2 -2
- package/skills/effect-development/SKILL.md +27 -0
- package/skills/effect-development/agents/openai.yaml +4 -0
- package/skills/effect-development/references/api/index.md +32 -0
- package/skills/effect-development/references/api/schema-codecs.md +15 -0
- package/skills/{build-effect-apis/references → effect-development/references/api}/verification.md +10 -5
- package/skills/{effect-architecture-audit/SKILL.md → effect-development/references/architecture/index.md} +1 -6
- package/skills/{effect-atom-state/references → effect-development/references/atom}/effect-atom-client.md +8 -6
- package/skills/{effect-atom-state/references → effect-development/references/atom}/effect-atom-testing.md +7 -2
- package/skills/effect-development/references/atom/index.md +40 -0
- package/skills/{build-effect-clis/references → effect-development/references/cli}/entrypoints-and-testing.md +6 -2
- package/skills/effect-development/references/cli/index.md +39 -0
- package/skills/effect-development/references/setup.md +15 -0
- package/skills/open-pull-request/SKILL.md +10 -70
- package/skills/open-pull-request/references/evidence.md +22 -0
- package/skills/open-pull-request/references/explanation.md +21 -0
- package/skills/open-pull-request/references/publication.md +21 -0
- package/skills/sentry/LICENSE +202 -0
- package/skills/sentry/LICENSE-UPSTREAM +21 -0
- package/skills/sentry/NOTICE +14 -0
- package/skills/sentry/SKILL.md +33 -0
- package/skills/sentry/references/alert-payloads.md +105 -0
- package/skills/sentry/references/alerts.md +17 -0
- package/skills/sentry/references/artifacts.md +25 -0
- package/skills/sentry/references/auth-token.md +65 -0
- package/skills/sentry/references/concepts/ai-monitoring.md +131 -0
- package/skills/sentry/references/concepts/choosing-a-signal.md +78 -0
- package/skills/sentry/references/concepts/crons.md +50 -0
- package/skills/sentry/references/concepts/data-scrubbing.md +43 -0
- package/skills/sentry/references/concepts/errors.md +40 -0
- package/skills/sentry/references/concepts/logging.md +85 -0
- package/skills/sentry/references/concepts/metrics.md +49 -0
- package/skills/sentry/references/concepts/monitors.md +78 -0
- package/skills/sentry/references/concepts/profiling.md +38 -0
- package/skills/sentry/references/concepts/reduce-volume.md +49 -0
- package/skills/sentry/references/concepts/releases.md +43 -0
- package/skills/sentry/references/concepts/session-replay.md +35 -0
- package/skills/sentry/references/concepts/tracing.md +54 -0
- package/skills/sentry/references/concepts/user-feedback.md +36 -0
- package/skills/sentry/references/debug-artifacts/android.md +68 -0
- package/skills/sentry/references/debug-artifacts/apple.md +96 -0
- package/skills/sentry/references/debug-artifacts/dotnet.md +70 -0
- package/skills/sentry/references/debug-artifacts/flutter.md +65 -0
- package/skills/sentry/references/debug-artifacts/index.md +75 -0
- package/skills/sentry/references/debug-artifacts/javascript.md +94 -0
- package/skills/sentry/references/debug-artifacts/matching.md +73 -0
- package/skills/sentry/references/debug-artifacts/react-native.md +75 -0
- package/skills/sentry/references/first-error-setup.md +25 -0
- package/skills/sentry/references/instrumentation.md +30 -0
- package/skills/sentry/references/issues.md +32 -0
- package/skills/sentry/references/new-project.md +17 -0
- package/skills/sentry/references/otel-exporter.md +30 -0
- package/skills/sentry/references/release-workflow.md +31 -0
- package/skills/sentry/references/releases/ci-pipeline.md +214 -0
- package/skills/sentry/references/releases/index.md +93 -0
- package/skills/sentry/references/releases/suspect-commits.md +155 -0
- package/skills/sentry/references/releases/tagging.md +131 -0
- package/skills/sentry/references/releases/troubleshooting.md +67 -0
- package/skills/sentry/references/sdks/android/crons.md +305 -0
- package/skills/sentry/references/sdks/android/error-monitoring.md +800 -0
- package/skills/sentry/references/sdks/android/index.md +748 -0
- package/skills/sentry/references/sdks/android/integrations.md +48 -0
- package/skills/sentry/references/sdks/android/logging.md +374 -0
- package/skills/sentry/references/sdks/android/metrics.md +288 -0
- package/skills/sentry/references/sdks/android/profiling.md +397 -0
- package/skills/sentry/references/sdks/android/session-replay.md +406 -0
- package/skills/sentry/references/sdks/android/tracing.md +861 -0
- package/skills/sentry/references/sdks/browser/error-monitoring.md +861 -0
- package/skills/sentry/references/sdks/browser/index.md +714 -0
- package/skills/sentry/references/sdks/browser/logging.md +315 -0
- package/skills/sentry/references/sdks/browser/profiling.md +236 -0
- package/skills/sentry/references/sdks/browser/session-replay.md +586 -0
- package/skills/sentry/references/sdks/browser/tracing.md +561 -0
- package/skills/sentry/references/sdks/browser/user-feedback.md +354 -0
- package/skills/sentry/references/sdks/cloudflare/ai-monitoring.md +661 -0
- package/skills/sentry/references/sdks/cloudflare/crons.md +231 -0
- package/skills/sentry/references/sdks/cloudflare/durable-objects.md +381 -0
- package/skills/sentry/references/sdks/cloudflare/error-monitoring.md +329 -0
- package/skills/sentry/references/sdks/cloudflare/index.md +698 -0
- package/skills/sentry/references/sdks/cloudflare/logging.md +169 -0
- package/skills/sentry/references/sdks/cloudflare/nodejs-compat.md +134 -0
- package/skills/sentry/references/sdks/cloudflare/tracing.md +475 -0
- package/skills/sentry/references/sdks/cocoa/error-monitoring.md +394 -0
- package/skills/sentry/references/sdks/cocoa/index.md +497 -0
- package/skills/sentry/references/sdks/cocoa/logging.md +209 -0
- package/skills/sentry/references/sdks/cocoa/metrics.md +136 -0
- package/skills/sentry/references/sdks/cocoa/profiling.md +223 -0
- package/skills/sentry/references/sdks/cocoa/session-replay.md +257 -0
- package/skills/sentry/references/sdks/cocoa/tracing.md +524 -0
- package/skills/sentry/references/sdks/cocoa/user-feedback.md +310 -0
- package/skills/sentry/references/sdks/dotnet/crons.md +465 -0
- package/skills/sentry/references/sdks/dotnet/error-monitoring.md +1100 -0
- package/skills/sentry/references/sdks/dotnet/index.md +614 -0
- package/skills/sentry/references/sdks/dotnet/logging.md +556 -0
- package/skills/sentry/references/sdks/dotnet/metrics.md +229 -0
- package/skills/sentry/references/sdks/dotnet/profiling.md +296 -0
- package/skills/sentry/references/sdks/dotnet/tracing.md +897 -0
- package/skills/sentry/references/sdks/elixir/crons.md +371 -0
- package/skills/sentry/references/sdks/elixir/error-monitoring.md +335 -0
- package/skills/sentry/references/sdks/elixir/index.md +383 -0
- package/skills/sentry/references/sdks/elixir/logging.md +239 -0
- package/skills/sentry/references/sdks/elixir/tracing.md +233 -0
- package/skills/sentry/references/sdks/flutter/ecosystem-integrations.md +70 -0
- package/skills/sentry/references/sdks/flutter/error-monitoring.md +312 -0
- package/skills/sentry/references/sdks/flutter/index.md +728 -0
- package/skills/sentry/references/sdks/flutter/logging.md +387 -0
- package/skills/sentry/references/sdks/flutter/metrics.md +310 -0
- package/skills/sentry/references/sdks/flutter/profiling.md +214 -0
- package/skills/sentry/references/sdks/flutter/session-replay.md +308 -0
- package/skills/sentry/references/sdks/flutter/tracing.md +502 -0
- package/skills/sentry/references/sdks/go/crons.md +270 -0
- package/skills/sentry/references/sdks/go/error-monitoring.md +361 -0
- package/skills/sentry/references/sdks/go/index.md +324 -0
- package/skills/sentry/references/sdks/go/logging.md +354 -0
- package/skills/sentry/references/sdks/go/metrics.md +273 -0
- package/skills/sentry/references/sdks/go/profiling.md +46 -0
- package/skills/sentry/references/sdks/go/tracing.md +366 -0
- package/skills/sentry/references/sdks/index.md +41 -0
- package/skills/sentry/references/sdks/nestjs/ai-monitoring.md +410 -0
- package/skills/sentry/references/sdks/nestjs/crons.md +268 -0
- package/skills/sentry/references/sdks/nestjs/error-monitoring.md +729 -0
- package/skills/sentry/references/sdks/nestjs/index.md +699 -0
- package/skills/sentry/references/sdks/nestjs/logging.md +174 -0
- package/skills/sentry/references/sdks/nestjs/metrics.md +243 -0
- package/skills/sentry/references/sdks/nestjs/profiling.md +127 -0
- package/skills/sentry/references/sdks/nestjs/tracing.md +762 -0
- package/skills/sentry/references/sdks/nextjs/ai-monitoring.md +494 -0
- package/skills/sentry/references/sdks/nextjs/crons.md +383 -0
- package/skills/sentry/references/sdks/nextjs/error-monitoring.md +974 -0
- package/skills/sentry/references/sdks/nextjs/index.md +491 -0
- package/skills/sentry/references/sdks/nextjs/logging.md +381 -0
- package/skills/sentry/references/sdks/nextjs/metrics.md +411 -0
- package/skills/sentry/references/sdks/nextjs/profiling.md +403 -0
- package/skills/sentry/references/sdks/nextjs/session-replay.md +462 -0
- package/skills/sentry/references/sdks/nextjs/tracing.md +628 -0
- package/skills/sentry/references/sdks/node/ai-monitoring.md +303 -0
- package/skills/sentry/references/sdks/node/crons.md +432 -0
- package/skills/sentry/references/sdks/node/error-monitoring.md +1125 -0
- package/skills/sentry/references/sdks/node/index.md +942 -0
- package/skills/sentry/references/sdks/node/logging.md +380 -0
- package/skills/sentry/references/sdks/node/metrics.md +278 -0
- package/skills/sentry/references/sdks/node/profiling.md +373 -0
- package/skills/sentry/references/sdks/node/tracing.md +878 -0
- package/skills/sentry/references/sdks/php/ai-monitoring.md +310 -0
- package/skills/sentry/references/sdks/php/crons.md +265 -0
- package/skills/sentry/references/sdks/php/error-monitoring.md +626 -0
- package/skills/sentry/references/sdks/php/index.md +362 -0
- package/skills/sentry/references/sdks/php/laravel.md +542 -0
- package/skills/sentry/references/sdks/php/logging.md +242 -0
- package/skills/sentry/references/sdks/php/metrics.md +193 -0
- package/skills/sentry/references/sdks/php/profiling.md +115 -0
- package/skills/sentry/references/sdks/php/symfony.md +552 -0
- package/skills/sentry/references/sdks/php/tracing.md +516 -0
- package/skills/sentry/references/sdks/python/ai-monitoring.md +351 -0
- package/skills/sentry/references/sdks/python/crons.md +218 -0
- package/skills/sentry/references/sdks/python/error-monitoring.md +292 -0
- package/skills/sentry/references/sdks/python/index.md +361 -0
- package/skills/sentry/references/sdks/python/logging.md +234 -0
- package/skills/sentry/references/sdks/python/metrics.md +154 -0
- package/skills/sentry/references/sdks/python/profiling.md +120 -0
- package/skills/sentry/references/sdks/python/tracing.md +364 -0
- package/skills/sentry/references/sdks/react/error-monitoring.md +1607 -0
- package/skills/sentry/references/sdks/react/index.md +492 -0
- package/skills/sentry/references/sdks/react/logging.md +364 -0
- package/skills/sentry/references/sdks/react/profiling.md +322 -0
- package/skills/sentry/references/sdks/react/react-features.md +1272 -0
- package/skills/sentry/references/sdks/react/session-replay.md +1193 -0
- package/skills/sentry/references/sdks/react/tracing.md +1415 -0
- package/skills/sentry/references/sdks/react-native/error-monitoring.md +1481 -0
- package/skills/sentry/references/sdks/react-native/expo-config-plugin.md +45 -0
- package/skills/sentry/references/sdks/react-native/index.md +1030 -0
- package/skills/sentry/references/sdks/react-native/logging.md +444 -0
- package/skills/sentry/references/sdks/react-native/profiling.md +386 -0
- package/skills/sentry/references/sdks/react-native/session-replay.md +704 -0
- package/skills/sentry/references/sdks/react-native/tracing.md +1086 -0
- package/skills/sentry/references/sdks/react-native/user-feedback.md +815 -0
- package/skills/sentry/references/sdks/react-router-framework/error-monitoring.md +127 -0
- package/skills/sentry/references/sdks/react-router-framework/index.md +411 -0
- package/skills/sentry/references/sdks/react-router-framework/logging.md +66 -0
- package/skills/sentry/references/sdks/react-router-framework/profiling.md +57 -0
- package/skills/sentry/references/sdks/react-router-framework/react-router-framework-features.md +110 -0
- package/skills/sentry/references/sdks/react-router-framework/session-replay.md +67 -0
- package/skills/sentry/references/sdks/react-router-framework/tracing.md +96 -0
- package/skills/sentry/references/sdks/react-router-framework/user-feedback.md +71 -0
- package/skills/sentry/references/sdks/ruby/crons.md +184 -0
- package/skills/sentry/references/sdks/ruby/error-monitoring.md +248 -0
- package/skills/sentry/references/sdks/ruby/index.md +297 -0
- package/skills/sentry/references/sdks/ruby/logging.md +168 -0
- package/skills/sentry/references/sdks/ruby/metrics.md +196 -0
- package/skills/sentry/references/sdks/ruby/migration.md +321 -0
- package/skills/sentry/references/sdks/ruby/profiling.md +107 -0
- package/skills/sentry/references/sdks/ruby/tracing.md +388 -0
- package/skills/sentry/references/sdks/svelte/error-monitoring.md +456 -0
- package/skills/sentry/references/sdks/svelte/index.md +467 -0
- package/skills/sentry/references/sdks/svelte/logging.md +344 -0
- package/skills/sentry/references/sdks/svelte/session-replay.md +369 -0
- package/skills/sentry/references/sdks/svelte/tracing.md +406 -0
- package/skills/sentry/references/sdks/tanstack-start/error-monitoring.md +149 -0
- package/skills/sentry/references/sdks/tanstack-start/index.md +381 -0
- package/skills/sentry/references/sdks/tanstack-start/logging.md +74 -0
- package/skills/sentry/references/sdks/tanstack-start/session-replay.md +76 -0
- package/skills/sentry/references/sdks/tanstack-start/tanstackstart-features.md +128 -0
- package/skills/sentry/references/sdks/tanstack-start/tracing.md +123 -0
- package/skills/sentry/references/sdks/tanstack-start/user-feedback.md +81 -0
- package/skills/sentry/references/search-query-language.md +226 -0
- package/skills/sentry/references/semantics/angular.md +7 -0
- package/skills/sentry/references/semantics/app.md +28 -0
- package/skills/sentry/references/semantics/art.md +17 -0
- package/skills/sentry/references/semantics/aws.md +43 -0
- package/skills/sentry/references/semantics/browser.md +34 -0
- package/skills/sentry/references/semantics/cache.md +12 -0
- package/skills/sentry/references/semantics/client.md +8 -0
- package/skills/sentry/references/semantics/cloud.md +12 -0
- package/skills/sentry/references/semantics/cloudflare.md +23 -0
- package/skills/sentry/references/semantics/code.md +11 -0
- package/skills/sentry/references/semantics/culture.md +11 -0
- package/skills/sentry/references/semantics/db.md +21 -0
- package/skills/sentry/references/semantics/device.md +43 -0
- package/skills/sentry/references/semantics/error.md +7 -0
- package/skills/sentry/references/semantics/event.md +8 -0
- package/skills/sentry/references/semantics/exception.md +10 -0
- package/skills/sentry/references/semantics/faas.md +19 -0
- package/skills/sentry/references/semantics/file.md +8 -0
- package/skills/sentry/references/semantics/flag.md +7 -0
- package/skills/sentry/references/semantics/gcp.md +16 -0
- package/skills/sentry/references/semantics/gen_ai.md +53 -0
- package/skills/sentry/references/semantics/general.md +11 -0
- package/skills/sentry/references/semantics/graphql.md +9 -0
- package/skills/sentry/references/semantics/grpc.md +19 -0
- package/skills/sentry/references/semantics/http.md +34 -0
- package/skills/sentry/references/semantics/index.md +63 -0
- package/skills/sentry/references/semantics/jsonrpc.md +8 -0
- package/skills/sentry/references/semantics/jvm.md +12 -0
- package/skills/sentry/references/semantics/koa.md +7 -0
- package/skills/sentry/references/semantics/logger.md +7 -0
- package/skills/sentry/references/semantics/mcp.md +37 -0
- package/skills/sentry/references/semantics/mdc.md +7 -0
- package/skills/sentry/references/semantics/messaging.md +23 -0
- package/skills/sentry/references/semantics/middleware.md +7 -0
- package/skills/sentry/references/semantics/navigation.md +9 -0
- package/skills/sentry/references/semantics/nel.md +11 -0
- package/skills/sentry/references/semantics/network.md +17 -0
- package/skills/sentry/references/semantics/os.md +15 -0
- package/skills/sentry/references/semantics/otel.md +10 -0
- package/skills/sentry/references/semantics/params.md +7 -0
- package/skills/sentry/references/semantics/process.md +14 -0
- package/skills/sentry/references/semantics/react.md +7 -0
- package/skills/sentry/references/semantics/remix.md +7 -0
- package/skills/sentry/references/semantics/resource.md +7 -0
- package/skills/sentry/references/semantics/rpc.md +10 -0
- package/skills/sentry/references/semantics/score.md +10 -0
- package/skills/sentry/references/semantics/sentry.md +69 -0
- package/skills/sentry/references/semantics/server.md +8 -0
- package/skills/sentry/references/semantics/service.md +8 -0
- package/skills/sentry/references/semantics/session.md +7 -0
- package/skills/sentry/references/semantics/state.md +7 -0
- package/skills/sentry/references/semantics/thread.md +8 -0
- package/skills/sentry/references/semantics/timber.md +7 -0
- package/skills/sentry/references/semantics/trpc.md +8 -0
- package/skills/sentry/references/semantics/ui.md +18 -0
- package/skills/sentry/references/semantics/url.md +15 -0
- package/skills/sentry/references/semantics/user.md +17 -0
- package/skills/sentry/references/semantics/user_agent.md +7 -0
- package/skills/sentry/references/semantics/vercel.md +42 -0
- package/skills/sentry/references/setup-verification.md +39 -0
- package/skills/sentry/references/snapshots/github-actions-fanout.md +206 -0
- package/skills/sentry/references/snapshots/github-actions-simple.md +102 -0
- package/skills/sentry/references/snapshots/github-actions-swift-snapshot-testing.md +118 -0
- package/skills/sentry/references/snapshots/index.md +19 -0
- package/skills/sentry/references/snapshots/snapshot-previews.md +100 -0
- package/skills/sentry/references/snapshots/snapshots.md +123 -0
- package/skills/sentry/references/snapshots/wizard-setup.md +134 -0
- package/skills/testing/LICENSE +21 -0
- package/skills/testing/NOTICE +7 -0
- package/skills/testing/SKILL.md +13 -19
- package/skills/testing/agents/openai.yaml +1 -2
- package/skills/testing/references/selection.md +23 -0
- package/skills/testing/references/tdd.md +19 -0
- package/skills/testing/references/test-design.md +17 -0
- package/src/catalog.ts +1 -7
- package/skills/build-effect-apis/SKILL.md +0 -81
- package/skills/build-effect-apis/agents/openai.yaml +0 -4
- package/skills/build-effect-clis/SKILL.md +0 -92
- package/skills/build-effect-clis/agents/openai.yaml +0 -4
- package/skills/effect-architecture-audit/agents/openai.yaml +0 -4
- package/skills/effect-atom-state/SKILL.md +0 -97
- package/skills/effect-atom-state/agents/openai.yaml +0 -4
- package/skills/effect-ts/SKILL.md +0 -35
- package/skills/effect-ts/agents/openai.yaml +0 -4
- /package/skills/{build-effect-apis/references → effect-development/references/api}/cloudflare-workers.md +0 -0
- /package/skills/{build-effect-apis/references → effect-development/references/api}/runtime-assembly.md +0 -0
- /package/skills/{build-effect-apis/references → effect-development/references/api}/server-and-middleware.md +0 -0
- /package/skills/{build-effect-apis/references → effect-development/references/api}/shared-contracts.md +0 -0
- /package/skills/{effect-architecture-audit/references → effect-development/references/architecture}/service-and-boundary-audit.md +0 -0
- /package/skills/{effect-atom-state/references → effect-development/references/atom}/effect-atom-lifecycle.md +0 -0
- /package/skills/{effect-atom-state/references → effect-development/references/atom}/effect-atom-workflows.md +0 -0
- /package/skills/{effect-atom-state/references → effect-development/references/atom}/tanstack-start.md +0 -0
- /package/skills/{build-effect-clis/references → effect-development/references/cli}/command-design.md +0 -0
- /package/skills/{build-effect-clis/references → effect-development/references/cli}/processes-and-platform.md +0 -0
|
@@ -0,0 +1,1030 @@
|
|
|
1
|
+
# Sentry React Native SDK
|
|
2
|
+
|
|
3
|
+
Opinionated wizard that scans your React Native or Expo project and guides you through
|
|
4
|
+
complete Sentry setup — error monitoring, tracing, profiling, session replay, logging,
|
|
5
|
+
and more.
|
|
6
|
+
|
|
7
|
+
> **Note:** SDK versions and APIs below reflect current Sentry docs at time of writing
|
|
8
|
+
> (`@sentry/react-native` ≥6.0.0, minimum recommended ≥8.0.0). Always verify against
|
|
9
|
+
> [docs.sentry.io/platforms/react-native/](https://docs.sentry.io/platforms/react-native/)
|
|
10
|
+
> before implementing.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## Phase 1: Detect
|
|
15
|
+
|
|
16
|
+
Run these commands to understand the project before making any recommendations:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
# Detect project type and existing Sentry
|
|
20
|
+
cat package.json | grep -E '"(react-native|expo|@expo|@sentry/react-native|sentry-expo)"'
|
|
21
|
+
|
|
22
|
+
# Distinguish Expo managed vs bare vs vanilla RN
|
|
23
|
+
ls app.json app.config.js app.config.ts 2>/dev/null
|
|
24
|
+
cat app.json 2>/dev/null | python3 -c "import sys,json; d=json.load(sys.stdin); print('Expo managed' if 'expo' in d else 'Bare/Vanilla')" 2>/dev/null
|
|
25
|
+
|
|
26
|
+
# Check Expo SDK version (important: Expo SDK 50+ required for @sentry/react-native)
|
|
27
|
+
cat package.json | grep '"expo"'
|
|
28
|
+
|
|
29
|
+
# Detect navigation library
|
|
30
|
+
grep -E '"(@react-navigation/native|react-native-navigation)"' package.json
|
|
31
|
+
|
|
32
|
+
# Detect state management (Redux → breadcrumb integration available)
|
|
33
|
+
grep -E '"(redux|@reduxjs/toolkit|zustand|mobx)"' package.json
|
|
34
|
+
|
|
35
|
+
# Check for existing Sentry initialization
|
|
36
|
+
grep -r "Sentry.init" src/ app/ App.tsx App.js _layout.tsx 2>/dev/null | head -5
|
|
37
|
+
|
|
38
|
+
# Detect Hermes (affects source map handling)
|
|
39
|
+
cat android/app/build.gradle 2>/dev/null | grep -i hermes
|
|
40
|
+
cat ios/Podfile 2>/dev/null | grep -i hermes
|
|
41
|
+
|
|
42
|
+
# Detect Expo Router
|
|
43
|
+
ls app/_layout.tsx app/_layout.js 2>/dev/null
|
|
44
|
+
|
|
45
|
+
# Detect backend for cross-link
|
|
46
|
+
ls backend/ server/ api/ 2>/dev/null
|
|
47
|
+
find . -maxdepth 3 \( -name "go.mod" -o -name "requirements.txt" -o -name "Gemfile" -o -name "package.json" \) 2>/dev/null | grep -v node_modules | head -10
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
**What to determine:**
|
|
51
|
+
|
|
52
|
+
| Question | Impact |
|
|
53
|
+
| ------------------------------------------------- | --------------------------------------------------------------------------- |
|
|
54
|
+
| `expo` in `package.json`? | Expo path (config plugin + `getSentryExpoConfig`) vs bare/vanilla RN path |
|
|
55
|
+
| Expo SDK ≥50? | `@sentry/react-native` directly; older = `sentry-expo` (legacy, do not use) |
|
|
56
|
+
| `app.json` has `"expo"` key? | Managed Expo — wizard is simplest; config plugin handles all native config |
|
|
57
|
+
| `app/_layout.tsx` present? | Expo Router project — init goes in `_layout.tsx` |
|
|
58
|
+
| `@sentry/react-native` already in `package.json`? | Skip install, jump to feature config |
|
|
59
|
+
| `@react-navigation/native` present? | Recommend `reactNavigationIntegration` for screen tracking |
|
|
60
|
+
| `react-native-navigation` present? | Recommend `reactNativeNavigationIntegration` (Wix) |
|
|
61
|
+
| Backend directory detected? | Trigger Phase 4 cross-link |
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## Phase 2: Recommend
|
|
66
|
+
|
|
67
|
+
Present a concrete recommendation based on what you found.
|
|
68
|
+
Don’t ask open-ended questions — lead with a proposal:
|
|
69
|
+
|
|
70
|
+
**Recommended (core coverage — always set up these):**
|
|
71
|
+
|
|
72
|
+
- ✅ **Error Monitoring** — captures JS exceptions, native crashes (iOS + Android), ANRs,
|
|
73
|
+
and app hangs
|
|
74
|
+
- ✅ **Tracing** — mobile performance is critical; auto-instruments navigation, app
|
|
75
|
+
start, network requests
|
|
76
|
+
- ✅ **Session Replay** — mobile replay captures screenshots and touch events for
|
|
77
|
+
debugging user issues
|
|
78
|
+
|
|
79
|
+
**Optional (enhanced observability):**
|
|
80
|
+
|
|
81
|
+
- ⚡ **Profiling** — CPU profiling on iOS (JS profiling cross-platform); low overhead in
|
|
82
|
+
production
|
|
83
|
+
- ⚡ **Logging** — structured logs via `Sentry.logger.*`; links to traces for full
|
|
84
|
+
context
|
|
85
|
+
- ⚡ **User Feedback** — collect user-submitted bug reports directly from your app
|
|
86
|
+
|
|
87
|
+
**Recommendation logic:**
|
|
88
|
+
|
|
89
|
+
| Feature | Recommend when … |
|
|
90
|
+
| ---------------- | --------------------------------------------------------------------------------------- |
|
|
91
|
+
| Error Monitoring | **Always** — non-negotiable baseline for any mobile app |
|
|
92
|
+
| Tracing | **Always for mobile** — app start, navigation, and network latency matter |
|
|
93
|
+
| Session Replay | User-facing production app; debug user-reported issues visually |
|
|
94
|
+
| Profiling | Performance-sensitive screens, startup time concerns, or production perf investigations |
|
|
95
|
+
| Logging | App uses structured logging, or you want log-to-trace correlation in Sentry |
|
|
96
|
+
| User Feedback | Beta or customer-facing app where you want user-submitted bug reports |
|
|
97
|
+
|
|
98
|
+
Propose: _“For your [Expo managed / bare RN] app, I recommend setting up Error
|
|
99
|
+
Monitoring + Tracing + Session Replay.
|
|
100
|
+
Want me to also add Profiling and Logging?”_
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## Phase 3: Guide
|
|
105
|
+
|
|
106
|
+
### Determine Your Setup Path
|
|
107
|
+
|
|
108
|
+
| Project type | Recommended setup | Complexity |
|
|
109
|
+
| ---------------------------- | --------------------------------------- | ----------------------------------------------------------------------------------- |
|
|
110
|
+
| Expo managed (SDK 50+) | Wizard CLI or manual with config plugin | Low — wizard does everything |
|
|
111
|
+
| Expo bare (SDK 50+) | Wizard CLI recommended | Medium — handles iOS/Android config |
|
|
112
|
+
| Vanilla React Native (0.69+) | Wizard CLI recommended | Medium — handles Xcode + Gradle |
|
|
113
|
+
| Expo SDK <50 | Use `sentry-expo` (legacy) | See [legacy docs](https://docs.sentry.io/platforms/react-native/manual-setup/expo/) |
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
### Path A: Wizard CLI (Recommended for all project types)
|
|
118
|
+
|
|
119
|
+
> **You need to run this yourself** — the wizard opens a browser for login and requires
|
|
120
|
+
> interactive input that the agent can’t handle.
|
|
121
|
+
> Copy-paste into your terminal:
|
|
122
|
+
>
|
|
123
|
+
> ```
|
|
124
|
+
> npx @sentry/wizard@latest -i reactNative
|
|
125
|
+
> ```
|
|
126
|
+
>
|
|
127
|
+
> It handles login, org/project selection, SDK installation, native config, source map
|
|
128
|
+
> upload, and `Sentry.init()`. Here’s what it creates/modifies:
|
|
129
|
+
|
|
130
|
+
| File | Action | Purpose |
|
|
131
|
+
| --------------------------- | --------------------------------------------------- | -------------------------------- |
|
|
132
|
+
| `package.json` | Installs `@sentry/react-native` | Core SDK |
|
|
133
|
+
| `metro.config.js` | Adds `@sentry/react-native/metro` serializer | Source map generation |
|
|
134
|
+
| `app.json` | Adds `@sentry/react-native/expo` plugin (Expo only) | Config plugin for native builds |
|
|
135
|
+
| `App.tsx` / `_layout.tsx` | Adds `Sentry.init()` and `Sentry.wrap()` | SDK initialization |
|
|
136
|
+
| `ios/sentry.properties` | Stores org/project/token | iOS source map + dSYM upload |
|
|
137
|
+
| `android/sentry.properties` | Stores org/project/token | Android source map upload |
|
|
138
|
+
| `android/app/build.gradle` | Adds Sentry Gradle plugin | Android source maps + proguard |
|
|
139
|
+
| `ios/[AppName].xcodeproj` | Wraps “Bundle RN” build phase + adds dSYM upload | iOS symbol upload |
|
|
140
|
+
| `.env.local` | `SENTRY_AUTH_TOKEN` | Auth token (add to `.gitignore`) |
|
|
141
|
+
|
|
142
|
+
> **Once it finishes, come back and skip to [Verification](#verification).**
|
|
143
|
+
|
|
144
|
+
If the user skips the wizard, proceed with Path B or C (Manual Setup) below based on
|
|
145
|
+
their project type.
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
149
|
+
### Path B: Manual — Expo Managed (SDK 50+)
|
|
150
|
+
|
|
151
|
+
**Step 1 — Install**
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
npx expo install @sentry/react-native
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
**Step 2 — `metro.config.js`**
|
|
158
|
+
|
|
159
|
+
```javascript
|
|
160
|
+
const { getSentryExpoConfig } = require("@sentry/react-native/metro");
|
|
161
|
+
const config = getSentryExpoConfig(__dirname, {
|
|
162
|
+
// Auto-wrap Expo Router ErrorBoundary exports at build time (SDK ≥8.17.0)
|
|
163
|
+
autoWrapExpoRouterErrorBoundary: true,
|
|
164
|
+
});
|
|
165
|
+
module.exports = config;
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
If `metro.config.js` doesn’t exist yet:
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
npx expo customize metro.config.js
|
|
172
|
+
# Then replace contents with the above
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
**Metro config options:**
|
|
176
|
+
|
|
177
|
+
| Option | Type | Default | Purpose |
|
|
178
|
+
| ---------------------------------- | --------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
179
|
+
| `autoWrapExpoRouterErrorBoundary` | `boolean` | `false` | Automatically wrap `export { ErrorBoundary } from 'expo-router'` with Sentry at build time (SDK ≥8.17.0). Captures errors that hit per-route ErrorBoundaries without manual wrapping |
|
|
180
|
+
| `annotateReactComponents` | `boolean` | `false` | Inject component names for better error context |
|
|
181
|
+
| `includeWebReplay` | `boolean` | `true` | Include web replay bundle (set `false` for native-only apps) |
|
|
182
|
+
| `includeWebFeedback` | `boolean` | `true` | Include web feedback bundle (set `false` for native-only apps) |
|
|
183
|
+
| `enableSourceContextInDevelopment` | `boolean` | `true` | Enable source context in dev builds |
|
|
184
|
+
|
|
185
|
+
**Step 3 — `app.json` — Add Expo config plugin**
|
|
186
|
+
|
|
187
|
+
```json
|
|
188
|
+
{
|
|
189
|
+
"expo": {
|
|
190
|
+
"plugins": [
|
|
191
|
+
[
|
|
192
|
+
"@sentry/react-native/expo",
|
|
193
|
+
{
|
|
194
|
+
"url": "https://sentry.io/",
|
|
195
|
+
"project": "YOUR_PROJECT_SLUG",
|
|
196
|
+
"organization": "YOUR_ORG_SLUG",
|
|
197
|
+
"disableAutoUpload": false
|
|
198
|
+
}
|
|
199
|
+
]
|
|
200
|
+
]
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
> **Note:** Set `SENTRY_AUTH_TOKEN` as an environment variable for native builds — never
|
|
206
|
+
> commit it to version control.
|
|
207
|
+
|
|
208
|
+
**Plugin options:**
|
|
209
|
+
|
|
210
|
+
| Option | Type | Default | Purpose |
|
|
211
|
+
| ------------------- | --------- | ---------------------- | --------------------------------------------------------------- |
|
|
212
|
+
| `url` | `string` | `"https://sentry.io/"` | Sentry instance URL |
|
|
213
|
+
| `project` | `string` | — | Project slug |
|
|
214
|
+
| `organization` | `string` | — | Organization slug |
|
|
215
|
+
| `disableAutoUpload` | `boolean` | `false` | Skip source map + dSYM upload during local builds (SDK ≥8.13.0) |
|
|
216
|
+
|
|
217
|
+
**Step 4 — Initialize Sentry**
|
|
218
|
+
|
|
219
|
+
For **Expo Router** (`app/_layout.tsx`):
|
|
220
|
+
|
|
221
|
+
```typescript
|
|
222
|
+
import { Stack } from "expo-router";
|
|
223
|
+
import { isRunningInExpoGo } from "expo";
|
|
224
|
+
import * as Sentry from "@sentry/react-native";
|
|
225
|
+
|
|
226
|
+
Sentry.init({
|
|
227
|
+
dsn: process.env.EXPO_PUBLIC_SENTRY_DSN ?? "YOUR_SENTRY_DSN",
|
|
228
|
+
sendDefaultPii: true,
|
|
229
|
+
|
|
230
|
+
// Tracing
|
|
231
|
+
tracesSampleRate: 1.0, // lower to 0.1–0.2 in production
|
|
232
|
+
|
|
233
|
+
// Profiling
|
|
234
|
+
profilesSampleRate: 1.0,
|
|
235
|
+
|
|
236
|
+
// Session Replay
|
|
237
|
+
replaysOnErrorSampleRate: 1.0,
|
|
238
|
+
replaysSessionSampleRate: 0.1,
|
|
239
|
+
|
|
240
|
+
// Logging (SDK ≥7.0.0)
|
|
241
|
+
enableLogs: true,
|
|
242
|
+
|
|
243
|
+
// Session Replay
|
|
244
|
+
integrations: [
|
|
245
|
+
Sentry.mobileReplayIntegration(),
|
|
246
|
+
],
|
|
247
|
+
|
|
248
|
+
enableNativeFramesTracking: !isRunningInExpoGo(), // slow/frozen frames
|
|
249
|
+
|
|
250
|
+
environment: __DEV__ ? "development" : "production",
|
|
251
|
+
});
|
|
252
|
+
|
|
253
|
+
function RootLayout() {
|
|
254
|
+
return <Stack />;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
export default Sentry.wrap(RootLayout);
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
> **Note:** Expo Router automatically handles navigation tracking.
|
|
261
|
+
> The `Sentry.NavigationContainer` wrapper is not needed for Expo Router projects —
|
|
262
|
+
> navigation spans are captured automatically.
|
|
263
|
+
|
|
264
|
+
**Expo Router ErrorBoundary Setup (SDK ≥8.16.0)**
|
|
265
|
+
|
|
266
|
+
Expo Router’s per-route `ErrorBoundary` swallows render errors by default — Sentry won’t
|
|
267
|
+
see them unless you explicitly capture them.
|
|
268
|
+
Two options:
|
|
269
|
+
|
|
270
|
+
1. **Auto-wrap (recommended, SDK ≥8.17.0)** — Enable
|
|
271
|
+
`autoWrapExpoRouterErrorBoundary: true` in `metro.config.js` (shown above).
|
|
272
|
+
The Babel plugin rewrites `export { ErrorBoundary } from 'expo-router'` automatically
|
|
273
|
+
in all route files.
|
|
274
|
+
|
|
275
|
+
2. **Manual wrap** — Wrap the boundary yourself in each route file:
|
|
276
|
+
|
|
277
|
+
```typescript
|
|
278
|
+
// app/_layout.tsx (or any route file)
|
|
279
|
+
import { ErrorBoundary as ExpoErrorBoundary } from "expo-router";
|
|
280
|
+
import * as Sentry from "@sentry/react-native";
|
|
281
|
+
|
|
282
|
+
export const ErrorBoundary = Sentry.wrapExpoRouterErrorBoundary(ExpoErrorBoundary);
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
Both methods capture errors that hit the boundary with route context (`route.name`,
|
|
286
|
+
`route.path`, `route.params`), tag the active navigation span as errored, and emit a
|
|
287
|
+
breadcrumb. Concrete paths/params respect `sendDefaultPii`.
|
|
288
|
+
|
|
289
|
+
For **standard Expo** (`App.tsx`):
|
|
290
|
+
|
|
291
|
+
```typescript
|
|
292
|
+
import { isRunningInExpoGo } from "expo";
|
|
293
|
+
import * as Sentry from "@sentry/react-native";
|
|
294
|
+
|
|
295
|
+
Sentry.init({
|
|
296
|
+
dsn: process.env.EXPO_PUBLIC_SENTRY_DSN ?? "YOUR_SENTRY_DSN",
|
|
297
|
+
sendDefaultPii: true,
|
|
298
|
+
tracesSampleRate: 1.0,
|
|
299
|
+
profilesSampleRate: 1.0,
|
|
300
|
+
replaysOnErrorSampleRate: 1.0,
|
|
301
|
+
replaysSessionSampleRate: 0.1,
|
|
302
|
+
enableLogs: true,
|
|
303
|
+
integrations: [
|
|
304
|
+
Sentry.mobileReplayIntegration(),
|
|
305
|
+
],
|
|
306
|
+
enableNativeFramesTracking: !isRunningInExpoGo(),
|
|
307
|
+
environment: __DEV__ ? "development" : "production",
|
|
308
|
+
});
|
|
309
|
+
|
|
310
|
+
function App() {
|
|
311
|
+
return (
|
|
312
|
+
<Sentry.NavigationContainer>
|
|
313
|
+
{/* your navigation here */}
|
|
314
|
+
</Sentry.NavigationContainer>
|
|
315
|
+
);
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
export default Sentry.wrap(App);
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
---
|
|
322
|
+
|
|
323
|
+
### Path C: Manual — Bare React Native (0.69+)
|
|
324
|
+
|
|
325
|
+
**Step 1 — Install**
|
|
326
|
+
|
|
327
|
+
```bash
|
|
328
|
+
npm install @sentry/react-native --save
|
|
329
|
+
cd ios && pod install
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
**Step 2 — `metro.config.js`**
|
|
333
|
+
|
|
334
|
+
```javascript
|
|
335
|
+
const { getDefaultConfig } = require("@react-native/metro-config");
|
|
336
|
+
const { withSentryConfig } = require("@sentry/react-native/metro");
|
|
337
|
+
|
|
338
|
+
const config = getDefaultConfig(__dirname);
|
|
339
|
+
module.exports = withSentryConfig(config, {
|
|
340
|
+
// Set to false to exclude @sentry-internal/replay from the native bundle (web only).
|
|
341
|
+
// includeWebReplay: true,
|
|
342
|
+
// Set to false to exclude @sentry-internal/feedback from the native bundle (web only).
|
|
343
|
+
// includeWebFeedback: true,
|
|
344
|
+
// Auto-wrap Expo Router ErrorBoundary exports at build time (SDK ≥8.17.0, Expo Router only)
|
|
345
|
+
// autoWrapExpoRouterErrorBoundary: true,
|
|
346
|
+
});
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
**Step 3 — iOS: Modify Xcode build phase**
|
|
350
|
+
|
|
351
|
+
Open `ios/[AppName].xcodeproj` in Xcode.
|
|
352
|
+
Find the **“Bundle React Native code and images”** build phase and replace the script
|
|
353
|
+
content with:
|
|
354
|
+
|
|
355
|
+
```bash
|
|
356
|
+
# RN 0.81.1+
|
|
357
|
+
set -e
|
|
358
|
+
WITH_ENVIRONMENT="../node_modules/react-native/scripts/xcode/with-environment.sh"
|
|
359
|
+
SENTRY_XCODE="../node_modules/@sentry/react-native/scripts/sentry-xcode.sh"
|
|
360
|
+
/bin/sh -c "$WITH_ENVIRONMENT $SENTRY_XCODE"
|
|
361
|
+
```
|
|
362
|
+
|
|
363
|
+
**Step 4 — iOS: Add “Upload Debug Symbols to Sentry” build phase**
|
|
364
|
+
|
|
365
|
+
Add a new **Run Script** build phase in Xcode (after the bundle phase):
|
|
366
|
+
|
|
367
|
+
```bash
|
|
368
|
+
/bin/sh ../node_modules/@sentry/react-native/scripts/sentry-xcode-debug-files.sh
|
|
369
|
+
```
|
|
370
|
+
|
|
371
|
+
**Step 5 — iOS: `ios/sentry.properties`**
|
|
372
|
+
|
|
373
|
+
```properties
|
|
374
|
+
defaults.url=https://sentry.io/
|
|
375
|
+
defaults.org=YOUR_ORG_SLUG
|
|
376
|
+
defaults.project=YOUR_PROJECT_SLUG
|
|
377
|
+
auth.token=YOUR_ORG_AUTH_TOKEN
|
|
378
|
+
```
|
|
379
|
+
|
|
380
|
+
**Step 6 — Android: `android/app/build.gradle`**
|
|
381
|
+
|
|
382
|
+
Add before the `android {}` block:
|
|
383
|
+
|
|
384
|
+
```groovy
|
|
385
|
+
apply from: "../../node_modules/@sentry/react-native/sentry.gradle.kts"
|
|
386
|
+
```
|
|
387
|
+
|
|
388
|
+
> **Note:** SDK ≥8.13.0 uses `sentry.gradle.kts` (Kotlin DSL). For older SDKs, use
|
|
389
|
+
> `sentry.gradle` (Groovy).
|
|
390
|
+
> Both are backward-compatible.
|
|
391
|
+
|
|
392
|
+
**Step 7 — Android: `android/sentry.properties`**
|
|
393
|
+
|
|
394
|
+
```properties
|
|
395
|
+
defaults.url=https://sentry.io/
|
|
396
|
+
defaults.org=YOUR_ORG_SLUG
|
|
397
|
+
defaults.project=YOUR_PROJECT_SLUG
|
|
398
|
+
auth.token=YOUR_ORG_AUTH_TOKEN
|
|
399
|
+
```
|
|
400
|
+
|
|
401
|
+
**Step 8 — Initialize Sentry (`App.tsx` or entry point)**
|
|
402
|
+
|
|
403
|
+
```typescript
|
|
404
|
+
import * as Sentry from "@sentry/react-native";
|
|
405
|
+
|
|
406
|
+
Sentry.init({
|
|
407
|
+
dsn: "YOUR_SENTRY_DSN",
|
|
408
|
+
sendDefaultPii: true,
|
|
409
|
+
tracesSampleRate: 1.0,
|
|
410
|
+
profilesSampleRate: 1.0,
|
|
411
|
+
replaysOnErrorSampleRate: 1.0,
|
|
412
|
+
replaysSessionSampleRate: 0.1,
|
|
413
|
+
enableLogs: true,
|
|
414
|
+
integrations: [
|
|
415
|
+
Sentry.mobileReplayIntegration(),
|
|
416
|
+
],
|
|
417
|
+
enableNativeFramesTracking: true,
|
|
418
|
+
environment: __DEV__ ? "development" : "production",
|
|
419
|
+
});
|
|
420
|
+
|
|
421
|
+
function App() {
|
|
422
|
+
return (
|
|
423
|
+
<Sentry.NavigationContainer>
|
|
424
|
+
{/* your navigation here */}
|
|
425
|
+
</Sentry.NavigationContainer>
|
|
426
|
+
);
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
export default Sentry.wrap(App);
|
|
430
|
+
```
|
|
431
|
+
|
|
432
|
+
---
|
|
433
|
+
|
|
434
|
+
### Quick Reference: Full-Featured `Sentry.init()`
|
|
435
|
+
|
|
436
|
+
This is the recommended starting configuration with all features enabled:
|
|
437
|
+
|
|
438
|
+
```typescript
|
|
439
|
+
import * as Sentry from "@sentry/react-native";
|
|
440
|
+
|
|
441
|
+
Sentry.init({
|
|
442
|
+
dsn: "YOUR_SENTRY_DSN",
|
|
443
|
+
sendDefaultPii: true,
|
|
444
|
+
|
|
445
|
+
// Tracing — lower to 0.1–0.2 in high-traffic production
|
|
446
|
+
tracesSampleRate: 1.0,
|
|
447
|
+
|
|
448
|
+
// Profiling — runs on a subset of traced transactions
|
|
449
|
+
profilesSampleRate: 1.0,
|
|
450
|
+
|
|
451
|
+
// Session Replay — always capture on error, sample 10% of all sessions
|
|
452
|
+
replaysOnErrorSampleRate: 1.0,
|
|
453
|
+
replaysSessionSampleRate: 0.1,
|
|
454
|
+
|
|
455
|
+
// Logging — enable Sentry.logger.* API
|
|
456
|
+
enableLogs: true,
|
|
457
|
+
|
|
458
|
+
// Integrations — mobile replay is opt-in
|
|
459
|
+
integrations: [
|
|
460
|
+
Sentry.mobileReplayIntegration({
|
|
461
|
+
maskAllText: true, // masks text by default for privacy
|
|
462
|
+
maskAllImages: true,
|
|
463
|
+
}),
|
|
464
|
+
],
|
|
465
|
+
|
|
466
|
+
// Native frames tracking (disable in Expo Go)
|
|
467
|
+
enableNativeFramesTracking: true,
|
|
468
|
+
|
|
469
|
+
// Environment
|
|
470
|
+
environment: __DEV__ ? "development" : "production",
|
|
471
|
+
|
|
472
|
+
// Release — set from CI or build system
|
|
473
|
+
// release: "my-app@1.0.0+1",
|
|
474
|
+
// dist: "1",
|
|
475
|
+
});
|
|
476
|
+
|
|
477
|
+
// REQUIRED: Wrap root component to capture React render errors
|
|
478
|
+
export default Sentry.wrap(App);
|
|
479
|
+
```
|
|
480
|
+
|
|
481
|
+
### App Start Accuracy — `Sentry.appLoaded()` (SDK ≥8.x)
|
|
482
|
+
|
|
483
|
+
If your app does significant async work after the root component mounts (e.g., fetching
|
|
484
|
+
config, waiting for auth), call `Sentry.appLoaded()` once that work is complete.
|
|
485
|
+
This signals the true end of app startup to Sentry and produces more accurate app start
|
|
486
|
+
duration measurements.
|
|
487
|
+
|
|
488
|
+
```typescript
|
|
489
|
+
// Call after async initialization is complete, e.g., in a useEffect or after a loading screen:
|
|
490
|
+
useEffect(() => {
|
|
491
|
+
fetchConfig().then(() => {
|
|
492
|
+
Sentry.appLoaded(); // marks the end of the app startup phase
|
|
493
|
+
});
|
|
494
|
+
}, []);
|
|
495
|
+
```
|
|
496
|
+
|
|
497
|
+
If you don’t call `Sentry.appLoaded()`, the SDK estimates the app start end
|
|
498
|
+
automatically.
|
|
499
|
+
|
|
500
|
+
---
|
|
501
|
+
|
|
502
|
+
### Navigation Setup — React Navigation (v5+)
|
|
503
|
+
|
|
504
|
+
**Recommended: Use `Sentry.NavigationContainer` wrapper (SDK ≥8.13.0)**
|
|
505
|
+
|
|
506
|
+
Drop-in replacement for `NavigationContainer` that automatically wires up navigation
|
|
507
|
+
tracking:
|
|
508
|
+
|
|
509
|
+
```typescript
|
|
510
|
+
import * as Sentry from "@sentry/react-native";
|
|
511
|
+
|
|
512
|
+
// Replace NavigationContainer with Sentry.NavigationContainer
|
|
513
|
+
<Sentry.NavigationContainer>
|
|
514
|
+
<Stack.Navigator>
|
|
515
|
+
{/* your screens */}
|
|
516
|
+
</Stack.Navigator>
|
|
517
|
+
</Sentry.NavigationContainer>
|
|
518
|
+
```
|
|
519
|
+
|
|
520
|
+
That’s it! The wrapper automatically:
|
|
521
|
+
|
|
522
|
+
- Creates the `reactNavigationIntegration`
|
|
523
|
+
- Registers the navigation container ref
|
|
524
|
+
- Captures breadcrumbs for navigation events (SDK ≥8.13.0)
|
|
525
|
+
- Tracks Time to Initial Display (TTID) per screen
|
|
526
|
+
|
|
527
|
+
**Alternative: Manual setup (for SDK <8.13.0 or custom config)**
|
|
528
|
+
|
|
529
|
+
```typescript
|
|
530
|
+
import { reactNavigationIntegration } from "@sentry/react-native";
|
|
531
|
+
import { NavigationContainer, createNavigationContainerRef } from "@react-navigation/native";
|
|
532
|
+
|
|
533
|
+
const navigationIntegration = reactNavigationIntegration({
|
|
534
|
+
enableTimeToInitialDisplay: true, // track TTID per screen
|
|
535
|
+
routeChangeTimeoutMs: 1_000, // max wait for route change to settle
|
|
536
|
+
ignoreEmptyBackNavigationTransactions: true,
|
|
537
|
+
});
|
|
538
|
+
|
|
539
|
+
// Add to Sentry.init integrations array
|
|
540
|
+
Sentry.init({
|
|
541
|
+
integrations: [navigationIntegration],
|
|
542
|
+
// ...
|
|
543
|
+
});
|
|
544
|
+
|
|
545
|
+
// In your component:
|
|
546
|
+
const navigationRef = createNavigationContainerRef();
|
|
547
|
+
|
|
548
|
+
<NavigationContainer
|
|
549
|
+
ref={navigationRef}
|
|
550
|
+
onReady={() => {
|
|
551
|
+
navigationIntegration.registerNavigationContainer(navigationRef);
|
|
552
|
+
}}
|
|
553
|
+
>
|
|
554
|
+
```
|
|
555
|
+
|
|
556
|
+
### Navigation Setup — Wix React Native Navigation
|
|
557
|
+
|
|
558
|
+
```typescript
|
|
559
|
+
import * as Sentry from "@sentry/react-native";
|
|
560
|
+
import { Navigation } from "react-native-navigation";
|
|
561
|
+
|
|
562
|
+
Sentry.init({
|
|
563
|
+
integrations: [Sentry.reactNativeNavigationIntegration({ navigation: Navigation })],
|
|
564
|
+
// ...
|
|
565
|
+
});
|
|
566
|
+
```
|
|
567
|
+
|
|
568
|
+
---
|
|
569
|
+
|
|
570
|
+
### Wrap Your Root Component
|
|
571
|
+
|
|
572
|
+
Always wrap your root component — this enables React error boundaries and ensures
|
|
573
|
+
crashes at the component tree level are captured:
|
|
574
|
+
|
|
575
|
+
```typescript
|
|
576
|
+
export default Sentry.wrap(App);
|
|
577
|
+
```
|
|
578
|
+
|
|
579
|
+
---
|
|
580
|
+
|
|
581
|
+
### For Each Agreed Feature
|
|
582
|
+
|
|
583
|
+
Walk through features one at a time.
|
|
584
|
+
Load the reference file for each, follow its steps, then verify before moving on:
|
|
585
|
+
|
|
586
|
+
| Feature | Reference | Load when … |
|
|
587
|
+
| --------------------- | ------------------------- | -------------------------------------------------- |
|
|
588
|
+
| Error Monitoring | `./error-monitoring.md` | Always (baseline) |
|
|
589
|
+
| Tracing & Performance | `./tracing.md` | Always for mobile (app start, navigation, network) |
|
|
590
|
+
| Profiling | `./profiling.md` | Performance-sensitive production apps |
|
|
591
|
+
| Session Replay | `./session-replay.md` | User-facing apps |
|
|
592
|
+
| Logging | `./logging.md` | Structured logging / log-to-trace correlation |
|
|
593
|
+
| User Feedback | `./user-feedback.md` | Collecting user-submitted reports |
|
|
594
|
+
| Expo Config Plugin | `./expo-config-plugin.md` | Configuring the `@sentry/react-native/expo` plugin |
|
|
595
|
+
|
|
596
|
+
For each feature: `Read ./<feature>.md`, follow steps exactly, verify it works.
|
|
597
|
+
|
|
598
|
+
---
|
|
599
|
+
|
|
600
|
+
## Configuration Reference
|
|
601
|
+
|
|
602
|
+
### Core `Sentry.init()` Options
|
|
603
|
+
|
|
604
|
+
| Option | Type | Default | Purpose |
|
|
605
|
+
| --------------------- | ---------------------- | ------- | ----------------------------------------------------------------------------------------------------------------------- |
|
|
606
|
+
| `dsn` | `string` | — | **Required.** Project DSN; SDK disabled if empty. Env: `SENTRY_DSN` |
|
|
607
|
+
| `environment` | `string` | — | e.g., `"production"`, `"staging"`. Env: `SENTRY_ENVIRONMENT` |
|
|
608
|
+
| `release` | `string` | — | App version, e.g., `"my-app@1.0.0+42"`. Env: `SENTRY_RELEASE` |
|
|
609
|
+
| `dist` | `string` | — | Build number / variant identifier (max 64 chars). Env: `SENTRY_DIST` |
|
|
610
|
+
| `sendDefaultPii` | `boolean` | `false` | Include PII: IP address, cookies, user data |
|
|
611
|
+
| `sampleRate` | `number` | `1.0` | Error event sampling (0.0–1.0) |
|
|
612
|
+
| `maxBreadcrumbs` | `number` | `100` | Max breadcrumbs per event |
|
|
613
|
+
| `attachStacktrace` | `boolean` | `true` | Auto-attach stack traces to messages |
|
|
614
|
+
| `attachScreenshot` | `boolean` | `false` | Capture screenshot on error (SDK ≥4.11.0) |
|
|
615
|
+
| `screenshot` | `object` | — | Fine-grained screenshot masking; only effective when `attachScreenshot: true`. See **Screenshot Masking Options** below |
|
|
616
|
+
| `attachViewHierarchy` | `boolean` | `false` | Attach JSON view hierarchy as attachment |
|
|
617
|
+
| `debug` | `boolean` | `false` | Verbose SDK output. **Never use in production** |
|
|
618
|
+
| `enabled` | `boolean` | `true` | Disable SDK entirely (e.g., for testing) |
|
|
619
|
+
| `ignoreErrors` | `string[] \| RegExp[]` | — | Drop errors matching these patterns |
|
|
620
|
+
| `ignoreTransactions` | `string[] \| RegExp[]` | — | Drop transactions matching these patterns |
|
|
621
|
+
| `maxCacheItems` | `number` | `30` | Max offline-cached envelopes |
|
|
622
|
+
| `defaultIntegrations` | `boolean` | `true` | Set `false` to disable all default integrations |
|
|
623
|
+
| `integrations` | `array \| function` | — | Add or filter integrations |
|
|
624
|
+
|
|
625
|
+
#### Screenshot Masking Options
|
|
626
|
+
|
|
627
|
+
Passed as the `screenshot` key inside `Sentry.init()` when `attachScreenshot: true`:
|
|
628
|
+
|
|
629
|
+
```typescript
|
|
630
|
+
Sentry.init({
|
|
631
|
+
attachScreenshot: true,
|
|
632
|
+
screenshot: {
|
|
633
|
+
maskAllText: true, // default: true — mask all text nodes
|
|
634
|
+
maskAllImages: true, // default: true — mask all images
|
|
635
|
+
maskedViewClasses: ["com.mapbox.maps.MapView"], // always mask these native view classes
|
|
636
|
+
unmaskedViewClasses: ["com.example.SafeView"], // always show these native view classes
|
|
637
|
+
},
|
|
638
|
+
});
|
|
639
|
+
```
|
|
640
|
+
|
|
641
|
+
| Sub-option | Type | Default | Purpose |
|
|
642
|
+
| --------------------- | ---------- | ------- | ---------------------------------------------------- |
|
|
643
|
+
| `maskAllText` | `boolean` | `true` | Mask all text nodes in the screenshot |
|
|
644
|
+
| `maskAllImages` | `boolean` | `true` | Mask all images in the screenshot |
|
|
645
|
+
| `maskedViewClasses` | `string[]` | `[]` | Native view class names to always mask (Android/iOS) |
|
|
646
|
+
| `unmaskedViewClasses` | `string[]` | `[]` | Native view class names to always show (Android/iOS) |
|
|
647
|
+
|
|
648
|
+
### Tracing Options
|
|
649
|
+
|
|
650
|
+
| Option | Type | Default | Purpose |
|
|
651
|
+
| ------------------------- | ---------------------- | -------- | ------------------------------------------------------ |
|
|
652
|
+
| `tracesSampleRate` | `number` | `0` | Transaction sample rate (0–1). Use `1.0` in dev |
|
|
653
|
+
| `tracesSampler` | `function` | — | Per-transaction sampling; overrides `tracesSampleRate` |
|
|
654
|
+
| `tracePropagationTargets` | `(string \| RegExp)[]` | `[/.*/]` | Which API URLs receive distributed tracing headers |
|
|
655
|
+
| `profilesSampleRate` | `number` | `0` | Profiling sample rate (applied to traced transactions) |
|
|
656
|
+
|
|
657
|
+
### Native / Mobile Options
|
|
658
|
+
|
|
659
|
+
| Option | Type | Default | Purpose |
|
|
660
|
+
| ----------------------------------- | ---------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
661
|
+
| `enableNative` | `boolean` | `true` | Set `false` for JS-only (no native SDK) |
|
|
662
|
+
| `enableNativeCrashHandling` | `boolean` | `true` | Capture native hard crashes (iOS/Android) |
|
|
663
|
+
| `enableNativeFramesTracking` | `boolean` | — | Slow/frozen frames tracking. **Disable in Expo Go** |
|
|
664
|
+
| `enableWatchdogTerminationTracking` | `boolean` | `true` | OOM kill detection (iOS) |
|
|
665
|
+
| `enableAppHangTracking` | `boolean` | `true` | App hang detection (iOS, tvOS, macOS) |
|
|
666
|
+
| `appHangTimeoutInterval` | `number` | `2` | Seconds before classifying as app hang (iOS) |
|
|
667
|
+
| `enableAutoPerformanceTracing` | `boolean` | `true` | Auto performance instrumentation |
|
|
668
|
+
| `enableNdkScopeSync` | `boolean` | `true` | Java→NDK scope sync (Android) |
|
|
669
|
+
| `attachThreads` | `boolean` | `false` | Auto-attach all threads on crash (Android) |
|
|
670
|
+
| `attachAllThreads` | `boolean` | `false` | Attach full stack traces for all threads to every captured event (iOS only, requires Cocoa SDK ≥9.9.0) |
|
|
671
|
+
| `autoInitializeNativeSdk` | `boolean` | `true` | Set `false` for manual native init |
|
|
672
|
+
| `onReady` | `function` | — | Callback after native SDKs initialize |
|
|
673
|
+
| `enableTurboModuleTracking` | `boolean` | `false` | **Experimental.** Install native TurboModule perf logger for crash attribution and per-module spans. RN 0.75+ New Architecture only; no-op on Old Architecture (SDK ≥8.17.0) |
|
|
674
|
+
|
|
675
|
+
### Session & Release Health Options
|
|
676
|
+
|
|
677
|
+
| Option | Type | Default | Purpose |
|
|
678
|
+
| ------------------------------- | --------- | ------- | -------------------------------------------- |
|
|
679
|
+
| `autoSessionTracking` | `boolean` | `true` | Session tracking (crash-free users/sessions) |
|
|
680
|
+
| `sessionTrackingIntervalMillis` | `number` | `30000` | ms of background before session ends |
|
|
681
|
+
|
|
682
|
+
### Replay Options
|
|
683
|
+
|
|
684
|
+
| Option | Type | Default | Purpose |
|
|
685
|
+
| -------------------------- | -------- | ------- | ----------------------------------- |
|
|
686
|
+
| `replaysSessionSampleRate` | `number` | `0` | Fraction of all sessions recorded |
|
|
687
|
+
| `replaysOnErrorSampleRate` | `number` | `0` | Fraction of error sessions recorded |
|
|
688
|
+
|
|
689
|
+
### Logging Options (SDK ≥7.0.0)
|
|
690
|
+
|
|
691
|
+
| Option | Type | Purpose |
|
|
692
|
+
| ----------------------- | --------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
|
|
693
|
+
| `enableLogs` | `boolean` | Enable `Sentry.logger.*` API |
|
|
694
|
+
| `enableAutoConsoleLogs` | `boolean` | Auto-capture `console.*` calls when `enableLogs: true`. Set `false` to use only manual `Sentry.logger.*` (SDK ≥8.14.0, default: `true`) |
|
|
695
|
+
| `beforeSendLog` | `function` | Filter/modify logs before sending |
|
|
696
|
+
| `logsOrigin` | `'native' \| 'js' \| 'all'` | Filter log source (SDK ≥7.7.0) |
|
|
697
|
+
|
|
698
|
+
### Hook Options
|
|
699
|
+
|
|
700
|
+
| Option | Type | Purpose |
|
|
701
|
+
| ----------------------- | ---------------------------------------------- | ------------------------------------------------------------------------------------------ |
|
|
702
|
+
| `beforeSend` | `(event, hint) => event \| null` | Modify/drop JS error events. ⚠️ Does NOT apply to native crashes |
|
|
703
|
+
| `beforeSendTransaction` | `(event) => event \| null` | Modify/drop transaction events |
|
|
704
|
+
| `beforeBreadcrumb` | `(breadcrumb, hint) => breadcrumb \| null` | Process breadcrumbs before storage |
|
|
705
|
+
| `onNativeLog` | `(log: { level, component, message }) => void` | Intercept native SDK log messages and forward to JS console. Only fires when `debug: true` |
|
|
706
|
+
|
|
707
|
+
### Environment Variables
|
|
708
|
+
|
|
709
|
+
| Variable | Purpose | Notes |
|
|
710
|
+
| ---------------------------------- | ----------------------------------------- | ------------------------------------ |
|
|
711
|
+
| `SENTRY_DSN` | Data Source Name | Falls back from `dsn` option |
|
|
712
|
+
| `SENTRY_AUTH_TOKEN` | Upload source maps and dSYMs | **Never commit — use CI secrets** |
|
|
713
|
+
| `SENTRY_ORG` | Organization slug | Used by wizard and build plugins |
|
|
714
|
+
| `SENTRY_PROJECT` | Project slug | Used by wizard and build plugins |
|
|
715
|
+
| `SENTRY_RELEASE` | Release identifier | Falls back from `release` option |
|
|
716
|
+
| `SENTRY_DIST` | Distribution identifier | Falls back from `dist` option |
|
|
717
|
+
| `SENTRY_ENVIRONMENT` | Environment name | Falls back from `environment` option |
|
|
718
|
+
| `SENTRY_DISABLE_AUTO_UPLOAD` | Skip source map upload | Set `true` during local builds |
|
|
719
|
+
| `EXPO_PUBLIC_SENTRY_DSN` | Expo public env var for DSN | Safe to embed in client bundle |
|
|
720
|
+
| `SENTRY_EAS_BUILD_CAPTURE_SUCCESS` | EAS build hook: capture successful builds | Set `true` in EAS secrets |
|
|
721
|
+
| `SENTRY_EAS_BUILD_TAGS` | EAS build hook: additional tags JSON | e.g., `{"team":"mobile"}` |
|
|
722
|
+
|
|
723
|
+
### Default Integrations (Auto-Enabled)
|
|
724
|
+
|
|
725
|
+
These integrations are enabled automatically — no config needed:
|
|
726
|
+
|
|
727
|
+
| Integration | What it does |
|
|
728
|
+
| -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
729
|
+
| `ReactNativeErrorHandlers` | Catches unhandled JS exceptions and promise rejections |
|
|
730
|
+
| `Release` | Attaches release/dist to all events |
|
|
731
|
+
| `Breadcrumbs` | Records console logs, HTTP requests, user gestures as breadcrumbs |
|
|
732
|
+
| `HttpClient` | Adds HTTP request/response breadcrumbs |
|
|
733
|
+
| `DeviceContext` | Attaches device/OS/battery info to events |
|
|
734
|
+
| `AppContext` | Attaches app version, bundle ID, and memory info |
|
|
735
|
+
| `CultureContext` | Attaches locale and timezone |
|
|
736
|
+
| `Screenshot` | Captures screenshot on error (when `attachScreenshot: true`) |
|
|
737
|
+
| `ViewHierarchy` | Attaches view hierarchy (when `attachViewHierarchy: true`) |
|
|
738
|
+
| `NativeLinkedErrors` | Links JS errors to their native crash counterparts |
|
|
739
|
+
| `TurboModuleContext` | Tracks TurboModule calls in crash-time context; attributes native crashes to the high-level RN module + method (e.g., `RNSentry.captureEnvelope`) |
|
|
740
|
+
|
|
741
|
+
### Opt-In Integrations
|
|
742
|
+
|
|
743
|
+
| Integration | How to enable |
|
|
744
|
+
| ------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------- |
|
|
745
|
+
| `mobileReplayIntegration()` | Add to `integrations` array |
|
|
746
|
+
| `reactNavigationIntegration()` | Add to `integrations` array |
|
|
747
|
+
| `reactNativeNavigationIntegration()` | Add to `integrations` array (Wix only) |
|
|
748
|
+
| `feedbackIntegration()` | Add to `integrations` array (user feedback widget; supports `enableShakeToReport` for native shake detection) |
|
|
749
|
+
| `deeplinkIntegration()` | Add to `integrations` array (auto-captures deep link URLs as breadcrumbs; opt-in) |
|
|
750
|
+
| `turboModuleContextIntegration()` | **Default** — tracks `RNSentry` TurboModule automatically. Optionally configure with `{ modules: [...] }` to track custom TurboModules |
|
|
751
|
+
|
|
752
|
+
### Tracking Custom TurboModules
|
|
753
|
+
|
|
754
|
+
The `TurboModuleContext` integration is enabled by default and automatically tracks the
|
|
755
|
+
built-in `RNSentry` TurboModule.
|
|
756
|
+
To track your own custom TurboModules, configure the integration explicitly:
|
|
757
|
+
|
|
758
|
+
```typescript
|
|
759
|
+
import * as Sentry from "@sentry/react-native";
|
|
760
|
+
import { NativeModules } from "react-native";
|
|
761
|
+
|
|
762
|
+
Sentry.init({
|
|
763
|
+
dsn: "YOUR_DSN",
|
|
764
|
+
integrations: [
|
|
765
|
+
Sentry.turboModuleContextIntegration({
|
|
766
|
+
modules: [
|
|
767
|
+
{
|
|
768
|
+
name: "MyCustomModule",
|
|
769
|
+
module: NativeModules.MyCustomModule,
|
|
770
|
+
// Optional: skip specific methods to avoid tracking overhead
|
|
771
|
+
skipMethods: ["addListener", "removeListeners"],
|
|
772
|
+
},
|
|
773
|
+
],
|
|
774
|
+
}),
|
|
775
|
+
],
|
|
776
|
+
});
|
|
777
|
+
```
|
|
778
|
+
|
|
779
|
+
When a native crash occurs inside a tracked TurboModule method call, the crash report
|
|
780
|
+
will include `contexts.turbo_module` with the module name and method, making it easier
|
|
781
|
+
to identify the exact RN API call that triggered the crash.
|
|
782
|
+
|
|
783
|
+
### Rage Tap Detection (TouchEventBoundary)
|
|
784
|
+
|
|
785
|
+
`TouchEventBoundary` (wraps your app root) includes built-in rage tap detection.
|
|
786
|
+
When a user taps the same element 3+ times within 1 second, a `ui.multiClick` breadcrumb
|
|
787
|
+
is emitted and shown on the replay timeline.
|
|
788
|
+
Configure via props:
|
|
789
|
+
|
|
790
|
+
```tsx
|
|
791
|
+
<Sentry.TouchEventBoundary
|
|
792
|
+
enableRageTapDetection={true} // default: true — set false to disable
|
|
793
|
+
rageTapThreshold={3} // taps required to trigger (default: 3)
|
|
794
|
+
rageTapTimeWindow={1000} // detection window in ms (default: 1000)
|
|
795
|
+
>
|
|
796
|
+
<App />
|
|
797
|
+
</Sentry.TouchEventBoundary>
|
|
798
|
+
```
|
|
799
|
+
|
|
800
|
+
### Production Settings
|
|
801
|
+
|
|
802
|
+
Lower sample rates and harden config before shipping to production:
|
|
803
|
+
|
|
804
|
+
```typescript
|
|
805
|
+
Sentry.init({
|
|
806
|
+
dsn: process.env.EXPO_PUBLIC_SENTRY_DSN,
|
|
807
|
+
environment: __DEV__ ? "development" : "production",
|
|
808
|
+
|
|
809
|
+
// Trace 10–20% of transactions in high-traffic production
|
|
810
|
+
tracesSampleRate: __DEV__ ? 1.0 : 0.1,
|
|
811
|
+
|
|
812
|
+
// Profile 100% of traced transactions (profiling is always a subset of tracing)
|
|
813
|
+
profilesSampleRate: 1.0,
|
|
814
|
+
|
|
815
|
+
// Replay all error sessions, sample 5% of normal sessions
|
|
816
|
+
replaysOnErrorSampleRate: 1.0,
|
|
817
|
+
replaysSessionSampleRate: __DEV__ ? 1.0 : 0.05,
|
|
818
|
+
|
|
819
|
+
// Set release and dist for accurate source map lookup
|
|
820
|
+
release: "my-app@" + Application.nativeApplicationVersion,
|
|
821
|
+
dist: String(Application.nativeBuildVersion),
|
|
822
|
+
|
|
823
|
+
// Disable debug logging in production
|
|
824
|
+
debug: __DEV__,
|
|
825
|
+
});
|
|
826
|
+
```
|
|
827
|
+
|
|
828
|
+
---
|
|
829
|
+
|
|
830
|
+
### Source Maps & Debug Symbols
|
|
831
|
+
|
|
832
|
+
Source maps and debug symbols are what transform minified stack traces into readable
|
|
833
|
+
ones. When set up correctly, Sentry shows you the exact line of your source code that
|
|
834
|
+
threw. The React Native-specific upload mechanics are below.
|
|
835
|
+
|
|
836
|
+
#### How Uploads Work
|
|
837
|
+
|
|
838
|
+
| Platform | What’s uploaded | When |
|
|
839
|
+
| -------------------- | ---------------------------------- | ---------------------------------- |
|
|
840
|
+
| **iOS** (JS) | Source maps (`.map` files) | During Xcode build |
|
|
841
|
+
| **iOS** (Native) | dSYM bundles | During Xcode archive / Xcode Cloud |
|
|
842
|
+
| **Android** (JS) | Source maps + Hermes `.hbc.map` | During Gradle build |
|
|
843
|
+
| **Android** (Native) | Proguard mapping + NDK `.so` files | During Gradle build |
|
|
844
|
+
|
|
845
|
+
#### Expo: Automatic Upload
|
|
846
|
+
|
|
847
|
+
The `@sentry/react-native/expo` config plugin automatically sets up upload hooks for
|
|
848
|
+
native builds. Source maps are uploaded during `eas build` and `expo run:ios/android`
|
|
849
|
+
(release).
|
|
850
|
+
|
|
851
|
+
```bash
|
|
852
|
+
SENTRY_AUTH_TOKEN=sntrys_... npx expo run:ios --configuration Release
|
|
853
|
+
```
|
|
854
|
+
|
|
855
|
+
#### Manual Upload (bare RN)
|
|
856
|
+
|
|
857
|
+
If you need to manually upload source maps:
|
|
858
|
+
|
|
859
|
+
```bash
|
|
860
|
+
npx sentry-cli sourcemaps upload \
|
|
861
|
+
--org YOUR_ORG \
|
|
862
|
+
--project YOUR_PROJECT \
|
|
863
|
+
--release "my-app@1.0.0+1" \
|
|
864
|
+
./dist
|
|
865
|
+
```
|
|
866
|
+
|
|
867
|
+
---
|
|
868
|
+
|
|
869
|
+
### EAS Build Hooks
|
|
870
|
+
|
|
871
|
+
Monitor your Expo Application Services (EAS) builds in Sentry.
|
|
872
|
+
The SDK ships three binary hooks — `sentry-eas-build-on-complete`,
|
|
873
|
+
`sentry-eas-build-on-error`, and `sentry-eas-build-on-success` — that capture build
|
|
874
|
+
events as Sentry errors or messages.
|
|
875
|
+
|
|
876
|
+
**Step 1 — Register the hook in `package.json`**
|
|
877
|
+
|
|
878
|
+
```json
|
|
879
|
+
{
|
|
880
|
+
"scripts": {
|
|
881
|
+
"eas-build-on-complete": "sentry-eas-build-on-complete"
|
|
882
|
+
}
|
|
883
|
+
}
|
|
884
|
+
```
|
|
885
|
+
|
|
886
|
+
Use `eas-build-on-complete` to capture both failures and (optionally) successes in one
|
|
887
|
+
hook. Alternatively use `eas-build-on-error` or `eas-build-on-success` separately if you
|
|
888
|
+
want independent control.
|
|
889
|
+
|
|
890
|
+
**Step 2 — Set `SENTRY_DSN` in your EAS secrets**
|
|
891
|
+
|
|
892
|
+
```bash
|
|
893
|
+
eas secret:create --name SENTRY_DSN --value "https://...@sentry.io/..."
|
|
894
|
+
```
|
|
895
|
+
|
|
896
|
+
The hook reads `SENTRY_DSN` from the build environment — it does not share the same
|
|
897
|
+
`.env` as your app.
|
|
898
|
+
|
|
899
|
+
**Optional environment variables:**
|
|
900
|
+
|
|
901
|
+
| Variable | Purpose |
|
|
902
|
+
| ---------------------------------- | -------------------------------------------------------------------------------- |
|
|
903
|
+
| `SENTRY_EAS_BUILD_CAPTURE_SUCCESS` | Set `true` to also capture successful builds (default: errors only) |
|
|
904
|
+
| `SENTRY_EAS_BUILD_TAGS` | JSON object of additional tags, e.g., `{"team":"mobile","channel":"production"}` |
|
|
905
|
+
| `SENTRY_EAS_BUILD_ERROR_MESSAGE` | Custom error message for failed builds |
|
|
906
|
+
| `SENTRY_EAS_BUILD_SUCCESS_MESSAGE` | Custom message for successful builds |
|
|
907
|
+
|
|
908
|
+
> **How it works:** The hook script is an EAS
|
|
909
|
+
> [npm lifecycle hook](https://docs.expo.dev/build-reference/npm-hooks/). EAS calls
|
|
910
|
+
> `package.json` scripts matching `eas-build-on-*` at the end of the build process.
|
|
911
|
+
> The script loads env from `@expo/env`, `.env`, or `.env.sentry-build-plugin` — without
|
|
912
|
+
> overwriting EAS secrets already in the environment.
|
|
913
|
+
|
|
914
|
+
---
|
|
915
|
+
|
|
916
|
+
## Verification
|
|
917
|
+
|
|
918
|
+
After setup, test that Sentry is receiving events:
|
|
919
|
+
|
|
920
|
+
```typescript
|
|
921
|
+
// Quick test — throws and Sentry.wrap(App) catches it
|
|
922
|
+
<Button
|
|
923
|
+
title="Test Sentry Error"
|
|
924
|
+
onPress={() => {
|
|
925
|
+
throw new Error("My first Sentry error!");
|
|
926
|
+
}}
|
|
927
|
+
/>
|
|
928
|
+
|
|
929
|
+
// Or capture manually
|
|
930
|
+
<Button
|
|
931
|
+
title="Test Sentry Message"
|
|
932
|
+
onPress={() => {
|
|
933
|
+
Sentry.captureMessage("Sentry test message", "info");
|
|
934
|
+
}}
|
|
935
|
+
/>
|
|
936
|
+
```
|
|
937
|
+
|
|
938
|
+
**Check the Sentry dashboard:**
|
|
939
|
+
|
|
940
|
+
- **Issues** → your test error should appear within seconds
|
|
941
|
+
- **Traces** → look for a “main” transaction with child spans
|
|
942
|
+
- **Replays** → session recording visible after app interaction (native build only — not
|
|
943
|
+
Expo Go)
|
|
944
|
+
- **Logs** → structured log entries if `enableLogs: true`
|
|
945
|
+
|
|
946
|
+
> ⚠️ **Expo Go limitation:** Native crashes, session replay, slow/frozen frames, TTID,
|
|
947
|
+
> and TTFD only work in native builds (`eas build` or `expo run`). Expo Go runs in a
|
|
948
|
+
> JS-only mode. Set `enableNativeFramesTracking: !isRunningInExpoGo()` to avoid warnings.
|
|
949
|
+
|
|
950
|
+
If nothing appears:
|
|
951
|
+
|
|
952
|
+
1. Set `debug: true` — SDK logs to Metro console
|
|
953
|
+
2. Verify DSN is correct and the Sentry project exists
|
|
954
|
+
3. Ensure `Sentry.wrap(App)` is applied to the root component
|
|
955
|
+
4. For native crashes, build a release build (crashes in debug mode may not forward)
|
|
956
|
+
|
|
957
|
+
---
|
|
958
|
+
|
|
959
|
+
## Phase 4: Cross-Link
|
|
960
|
+
|
|
961
|
+
After completing React Native setup, check for a backend or web frontend missing Sentry
|
|
962
|
+
coverage:
|
|
963
|
+
|
|
964
|
+
```bash
|
|
965
|
+
# Adjacent backend directories
|
|
966
|
+
ls ../backend ../server ../api 2>/dev/null
|
|
967
|
+
cat ../go.mod 2>/dev/null | head -3
|
|
968
|
+
cat ../requirements.txt ../pyproject.toml 2>/dev/null | head -3
|
|
969
|
+
cat ../Gemfile 2>/dev/null | head -3
|
|
970
|
+
ls ../backend/package.json ../server/package.json 2>/dev/null
|
|
971
|
+
|
|
972
|
+
# Web frontend in same or sibling repo
|
|
973
|
+
ls ../web ../frontend ../dashboard 2>/dev/null
|
|
974
|
+
cat ../web/package.json ../frontend/package.json 2>/dev/null | grep -E '"react"|"svelte"|"next"'
|
|
975
|
+
|
|
976
|
+
# Check for OpenTelemetry (for distributed tracing interop)
|
|
977
|
+
grep -r "opentelemetry" ../backend/go.mod ../server/requirements.txt 2>/dev/null
|
|
978
|
+
```
|
|
979
|
+
|
|
980
|
+
If a backend or web frontend exists without Sentry, suggest the matching skill:
|
|
981
|
+
|
|
982
|
+
| Detected | Suggest skill |
|
|
983
|
+
| ----------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
|
|
984
|
+
| Go backend (`go.mod`) | [`go`](../go/index.md) |
|
|
985
|
+
| Python backend (`requirements.txt`, `pyproject.toml`) | [`python`](../python/index.md) |
|
|
986
|
+
| Ruby backend (`Gemfile`) | [`ruby`](../ruby/index.md) |
|
|
987
|
+
| Node.js backend (Express, Fastify, etc.) | `@sentry/node` — see [docs.sentry.io/platforms/javascript/guides/express/](https://docs.sentry.io/platforms/javascript/guides/express/) |
|
|
988
|
+
| React / Next.js web | [`react`](../react/index.md) |
|
|
989
|
+
| Svelte / SvelteKit web | [`svelte`](../svelte/index.md) |
|
|
990
|
+
|
|
991
|
+
**Distributed tracing setup** — if the backend skill is added, configure
|
|
992
|
+
`tracePropagationTargets` in React Native to propagate trace context to your API:
|
|
993
|
+
|
|
994
|
+
```typescript
|
|
995
|
+
Sentry.init({
|
|
996
|
+
tracePropagationTargets: ["localhost", /^https:\/\/api\.yourapp\.com/],
|
|
997
|
+
// ...
|
|
998
|
+
});
|
|
999
|
+
```
|
|
1000
|
+
|
|
1001
|
+
This links mobile transactions to backend traces in the Sentry waterfall view.
|
|
1002
|
+
|
|
1003
|
+
---
|
|
1004
|
+
|
|
1005
|
+
## Troubleshooting
|
|
1006
|
+
|
|
1007
|
+
| Issue | Solution |
|
|
1008
|
+
| ---------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
|
|
1009
|
+
| Events not appearing in Sentry | Set `debug: true`, check Metro/Xcode console for SDK errors; verify DSN is correct |
|
|
1010
|
+
| `pod install` fails | Run `cd ios && pod install --repo-update`; check CocoaPods version |
|
|
1011
|
+
| iOS build fails with Sentry script | Verify the “Bundle React Native code and images” script was replaced (not appended to) |
|
|
1012
|
+
| Android build fails after adding `sentry.gradle.kts` | Ensure `apply from` line is before the `android {}` block in `build.gradle`; use `sentry.gradle` for SDK <8.13.0 |
|
|
1013
|
+
| Android Gradle 8+ compatibility issue | Use `sentry-android-gradle-plugin` ≥4.0.0; check `sentry.gradle` version in your SDK |
|
|
1014
|
+
| Source maps not uploading | Verify `sentry.properties` has a valid `auth.token`; check build logs for `sentry-cli` output |
|
|
1015
|
+
| Source maps not resolving in Sentry | Confirm `release` and `dist` in `Sentry.init()` match the uploaded bundle metadata |
|
|
1016
|
+
| Hermes source maps not working | Hermes emits `.hbc.map` — the Gradle plugin handles this automatically; verify `sentry.gradle` is applied |
|
|
1017
|
+
| Session replay not recording | Must use a native build (not Expo Go); confirm `mobileReplayIntegration()` is in `integrations` |
|
|
1018
|
+
| Replay shows blank/black screens | Check that `maskAllText`/`maskAllImages` settings match your privacy requirements |
|
|
1019
|
+
| Slow/frozen frames not tracked | Set `enableNativeFramesTracking: true` and confirm you’re on a native build (not Expo Go) |
|
|
1020
|
+
| TTID / TTFD not appearing | Requires `enableTimeToInitialDisplay: true` in `reactNavigationIntegration()` on a native build |
|
|
1021
|
+
| App crashes on startup after adding Sentry | Likely a native initialization error — check Xcode/Logcat logs; try `enableNative: false` to isolate |
|
|
1022
|
+
| Expo SDK 49 or older | Use `sentry-expo` (legacy package); `@sentry/react-native` requires Expo SDK 50+ |
|
|
1023
|
+
| `isRunningInExpoGo` import error | Import from `expo` package: `import { isRunningInExpoGo } from "expo"` |
|
|
1024
|
+
| Node not found during Xcode build | Add `export NODE_BINARY=$(which node)` to the Xcode build phase, or symlink: `ln -s $(which node) /usr/local/bin/node` |
|
|
1025
|
+
| Expo Go warning about native features | Use `isRunningInExpoGo()` guard: `enableNativeFramesTracking: !isRunningInExpoGo()` |
|
|
1026
|
+
| `beforeSend` not firing for native crashes | Expected — `beforeSend` only intercepts JS-layer errors; native crashes bypass it |
|
|
1027
|
+
| Android 15+ (16KB page size) crash | Upgrade to `@sentry/react-native` ≥6.3.0 |
|
|
1028
|
+
| Too many transactions in dashboard | Lower `tracesSampleRate` to `0.1` or use `tracesSampler` to drop health checks |
|
|
1029
|
+
| `SENTRY_AUTH_TOKEN` exposed in app bundle | `SENTRY_AUTH_TOKEN` is for build-time upload only — never pass it to `Sentry.init()` |
|
|
1030
|
+
| EAS Build: Sentry auth token missing | Set `SENTRY_AUTH_TOKEN` as an EAS secret: `eas secret:create --name SENTRY_AUTH_TOKEN` |
|