Official agent skill

Sentry Flutter SDK

by getsentry in getsentry/sentry-for-ai

Full Sentry SDK setup for Flutter and Dart. An agent skill from getsentry/sentry-for-ai.

OfficialApache-2.0Auto-check passedMobile

Install Sentry Flutter SDK

skills CLI
$ npx skills add getsentry/sentry-for-ai --skill sentry-flutter-sdk -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install getsentry/sentry-for-ai sentry-flutter-sdk --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/getsentry/sentry-for-ai.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills-legacy/sentry-flutter-sdk .claude/skills/sentry-flutter-sdk && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
sentry-flutter-sdk
GitHub stars
268
Token cost
~7.1k tokens
SKILL.md length
1,935 words
Files
8 (incl. references)
Skills in repo
32
Repo updated
First seen
Licence
Apache-2.0

At a glance

Full Sentry SDK setup for Flutter and Dart. An agent skill from getsentry/sentry-for-ai.

  • Works in 4 steps: Detect → Recommend → Guide → …
  • Asked to add Sentry to Flutter
  • SKILL.md covers Invoke This Skill When, Phase 1: Detect, Phase 2: Recommend and Phase 3: Guide, plus 4 more sections
  • Calls flutter and dart; reaches sentry.io; needs SENTRY_AUTH_TOKEN

What it does

Sentry Flutter SDK is an agent skill from getsentry/sentry-for-ai, published by the product's own GitHub organization. Full Sentry SDK setup for Flutter and Dart. Use when asked to "add Sentry to Flutter", "install sentryflutter", "setup Sentry in Dart", or configure error monitoring, tracing, profiling, session replay, or logging for Flutter applications. Supports Android, iOS, macOS, Linux, Windows, and Web.

Its SKILL.md is about 7.1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 8 other files, including reference files (for example `references/ecosystem-integrations.md`, `references/error-monitoring.md` and `references/logging.md`).

It sits in Mobile, covering Cross-platform mobile apps. It works with Sentry, Flutter, Dart and Android. The repository describes itself as: Teach your AI coding assistant how to use Sentry - setup, debugging, alerts, and more. The licence is Apache-2.0.

When your agent uses it

  • Asked to add Sentry to Flutter
  • Install sentryflutter
  • Setup Sentry in Dart
  • Configure error monitoring

Example prompts

  • “add Sentry to Flutter”
  • “install sentryflutter”
  • “setup Sentry in Dart”
  • “/sentry-flutter-sdk”

Requirements

  • A credential in YOUR_AUTH_TOKEN
  • A credential in SENTRY_AUTH_TOKEN

Workflow steps

4 steps, taken from the step headings in SKILL.md.

  1. Detect
  2. Recommend
  3. Guide
  4. Cross-Link

What it can do on your machine

Read from SKILL.md and the folder at commit d8fd106. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • flutter
    • dart

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • sentry.io

    Also links to:

    • docs.sentry.io

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • SENTRY_AUTH_TOKEN

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Sentry Flutter SDK loads about 7.1k tokens when it runs, and up to ~24k if it reads all its reference files. Until then it costs about 79 tokens; SKILL.md has 1,935 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~79
When it runs · the whole SKILL.md, loaded when a task matches
~7.1k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~24k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from getsentry/sentry-for-ai at commit d8fd106, republished under its Apache-2.0 licence (© getsentry). 1,935 words, ~7,052 tokens.

Download SKILL.mdSave it as .claude/skills/sentry-flutter-sdk/SKILL.md (or your agent's skills folder). This skill also uses 7 other files; get the full folder from GitHub.
name
sentry-flutter-sdk
description
Full Sentry SDK setup for Flutter and Dart. Use when asked to "add Sentry to Flutter", "install sentry_flutter", "setup Sentry in Dart", or configure error monitoring, tracing, profiling, session replay, or logging for Flutter applications. Supports Android, iOS, macOS, Linux, Windows, and Web.
license
Apache-2.0
category
sdk-setup
parent
sentry-sdk-setup
disable-model-invocation
true

All Skills > SDK Setup > Flutter SDK

Sentry Flutter SDK

Opinionated wizard that scans your Flutter or Dart project and guides you through complete Sentry setup — error monitoring, tracing, session replay, logging, profiling, and ecosystem integrations.

Invoke This Skill When

  • User asks to "add Sentry to Flutter" or "set up Sentry" in a Flutter or Dart app
  • User wants error monitoring, tracing, profiling, session replay, or logging in Flutter
  • User mentions sentry_flutter, sentry_dart, mobile error tracking, or Sentry for Flutter
  • User wants to monitor native crashes, ANRs, or app hangs on iOS/Android

Note: SDK versions and APIs below reflect sentry_flutter ≥9.14.0 (current stable, February 2026). Always verify against docs.sentry.io/platforms/flutter/ before implementing.


Phase 1: Detect

Run these commands to understand the project before making any recommendations:

bash
# Detect Flutter project type and existing Sentry
cat pubspec.yaml | grep -E '(sentry|flutter|dart)'

# Check SDK version
cat pubspec.yaml | grep -A2 'environment:'

# Check for existing Sentry initialization
grep -r "SentryFlutter.init\|Sentry.init" lib/ 2>/dev/null | head -5

# Detect navigation library
grep -E '(go_router|auto_route|get:|beamer|routemaster)' pubspec.yaml

# Detect HTTP client
grep -E '(dio:|http:|chopper:)' pubspec.yaml

# Detect database packages
grep -E '(sqflite|drift|hive|isar|floor)' pubspec.yaml

# Detect state management (for integration patterns)
grep -E '(flutter_bloc|riverpod|provider:|get:)' pubspec.yaml

# Detect GraphQL
grep -E '(graphql|ferry|gql)' pubspec.yaml

# Detect Firebase
grep -E '(firebase_core|supabase)' pubspec.yaml

# Detect backend for cross-link
ls ../backend/ ../server/ ../api/ 2>/dev/null
find .. -maxdepth 3 \( -name "go.mod" -o -name "requirements.txt" -o -name "Gemfile" -o -name "*.csproj" \) 2>/dev/null | grep -v flutter | head -10

# Detect platform targets
ls android/ ios/ macos/ linux/ windows/ web/ 2>/dev/null

What to determine:

QuestionImpact
sentry_flutter already in pubspec.yaml?Skip install, jump to feature config
Dart SDK >=3.5?Required for sentry_flutter ≥9.0.0
go_router or auto_route present?Use SentryNavigatorObserver — specific patterns apply
dio present?Recommend sentry_dio integration
sqflite, drift, hive, isar present?Recommend matching sentry_* DB package
Has android/ and ios/ directories?Full mobile feature set available
Has web/ directory only?Session Replay and Profiling unavailable
Has macos/ directory?Profiling available (alpha)
Backend directory detected?Trigger Phase 4 cross-link

Phase 2: Recommend

Present a concrete recommendation based on what you found. Don't ask open-ended questions — lead with a proposal:

Recommended (core coverage — always set up these):

  • ✅ Error Monitoring — captures Dart exceptions, Flutter framework errors, and native crashes (iOS + Android)
  • ✅ Tracing — auto-instruments navigation, app start, network requests, and UI interactions
  • ✅ Session Replay — captures widget tree screenshots for debugging (iOS + Android only)

Optional (enhanced observability):

  • ⚡ Profiling — CPU profiling; iOS and macOS only (alpha)
  • ⚡ Logging — structured logs via Sentry.logger.* and sentry_logging integration
  • ⚡ Metrics — counters, gauges, distributions (SDK ≥9.11.0)

Platform limitations — be upfront:

FeaturePlatformsNotes
Session ReplayiOS, AndroidNot available on macOS, Linux, Windows, Web
ProfilingiOS, macOSAlpha status; not available on Android, Linux, Windows, Web
Native crashesiOS, Android, macOSNDK/signal handling; Linux/Windows/Web: Dart exceptions only
App Start metricsiOS, AndroidNot available on desktop/web
Slow/frozen framesiOS, Android, macOSNot available on Linux, Windows, Web
CronsN/ANot available in the Flutter/Dart SDK

Propose: "For your Flutter app targeting iOS/Android, I recommend Error Monitoring + Tracing + Session Replay. Want me to also add Logging and Profiling (iOS/macOS alpha)?"


Phase 3: Guide

Determine Your Setup Path
Project typeRecommended setup
Any Flutter appWizard CLI (handles pubspec, init, symbol upload)
Manual preferredPath B below — pubspec.yaml + main.dart
Dart-only (CLI, server)Path C below — pure sentry package

You need to run this yourself — the wizard opens a browser for login and requires interactive input that the agent can't handle. Copy-paste into your terminal:

bash
brew install getsentry/tools/sentry-wizard && sentry-wizard -i flutter

It handles org/project selection, adds sentry_flutter to pubspec.yaml, updates main.dart, configures sentry_dart_plugin for debug symbol upload, and adds build scripts. Here's what it creates/modifies:

FileActionPurpose
pubspec.yamlAdds sentry_flutter dependency and sentry: config blockSDK + symbol upload config
lib/main.dartWraps main() with SentryFlutter.init()SDK initialization
android/app/build.gradleAdds Proguard config referenceAndroid obfuscation support
.sentryclircAuth token and org/project configSymbol upload credentials

Once it finishes, come back and skip to Verification.

If the user skips the wizard, proceed with Path B (Manual Setup) below.


Path B: Manual — Flutter App

Step 1 — Install

bash
flutter pub add sentry_flutter

Or add to pubspec.yaml manually:

yaml
dependencies:
  flutter:
    sdk: flutter
  sentry_flutter: ^9.14.0

Then run:

bash
flutter pub get

Step 2 — Initialize Sentry in lib/main.dart

dart
import 'package:flutter/widgets.dart';
import 'package:sentry_flutter/sentry_flutter.dart';

Future<void> main() async {
  await SentryFlutter.init(
    (options) {
      options.dsn = 'YOUR_SENTRY_DSN';
      options.sendDefaultPii = true;

      // Tracing
      options.tracesSampleRate = 1.0; // lower to 0.1–0.2 in production

      // Profiling (iOS and macOS only — alpha)
      options.profilesSampleRate = 1.0;

      // Session Replay (iOS and Android only)
      options.replay.sessionSampleRate = 0.1;
      options.replay.onErrorSampleRate = 1.0;

      // Structured Logging (SDK ≥9.5.0)
      options.enableLogs = true;

      options.environment = const bool.fromEnvironment('dart.vm.product')
          ? 'production'
          : 'development';
    },
    // REQUIRED: wrap root widget to enable screenshots, replay, user interaction tracing
    appRunner: () => runApp(SentryWidget(child: MyApp())),
  );
}

Step 3 — Add Navigation Observer

Add SentryNavigatorObserver to your MaterialApp or CupertinoApp:

dart
import 'package:flutter/material.dart';
import 'package:sentry_flutter/sentry_flutter.dart';

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      navigatorObservers: [
        SentryNavigatorObserver(),
      ],
      // Always name your routes for Sentry to track them
      routes: {
        '/': (context) => HomeScreen(),
        '/profile': (context) => ProfileScreen(),
      },
    );
  }
}

For GoRouter:

dart
import 'package:go_router/go_router.dart';
import 'package:sentry_flutter/sentry_flutter.dart';

final GoRouter router = GoRouter(
  observers: [SentryNavigatorObserver()],
  routes: [
    GoRoute(
      path: '/',
      name: 'home', // name is REQUIRED for Sentry route tracking
      builder: (context, state) => const HomeScreen(),
      routes: [
        GoRoute(
          path: 'profile/:id',
          name: 'profile', // name is REQUIRED
          builder: (context, state) => ProfileScreen(
            id: state.pathParameters['id']!,
          ),
        ),
      ],
    ),
  ],
);

Step 4 — Configure Debug Symbol Upload

Readable stack traces in Sentry require uploading debug symbols when building with --obfuscate.

Add to pubspec.yaml:

yaml
dev_dependencies:
  sentry_dart_plugin: ^3.2.1

sentry:
  project: YOUR_PROJECT_SLUG
  org: YOUR_ORG_SLUG
  auth_token: YOUR_AUTH_TOKEN  # prefer SENTRY_AUTH_TOKEN env var instead
  upload_debug_symbols: true
  upload_sources: true
  upload_source_maps: true     # for Web

Build and upload:

bash
# Android
flutter build apk \
  --release \
  --obfuscate \
  --split-debug-info=build/debug-info \
  --extra-gen-snapshot-options=--save-obfuscation-map=build/app/obfuscation.map.json
dart run sentry_dart_plugin

# iOS
flutter build ipa \
  --release \
  --obfuscate \
  --split-debug-info=build/debug-info \
  --extra-gen-snapshot-options=--save-obfuscation-map=build/app/obfuscation.map.json
dart run sentry_dart_plugin

# Web
flutter build web --release --source-maps
dart run sentry_dart_plugin

Path C: Manual — Dart-Only (CLI / Server)
yaml
# pubspec.yaml
dependencies:
  sentry: ^9.14.0
dart
import 'package:sentry/sentry.dart';

Future<void> main() async {
  await Sentry.init(
    (options) {
      options.dsn = 'YOUR_SENTRY_DSN';
      options.tracesSampleRate = 1.0;
      options.enableLogs = true;
    },
    appRunner: myApp,
  );
}

dart
import 'package:sentry_flutter/sentry_flutter.dart';

Future<void> main() async {
  await SentryFlutter.init(
    (options) {
      options.dsn = 'YOUR_SENTRY_DSN';
      options.sendDefaultPii = true;

      // Environment — detect release builds via dart.vm.product
      options.environment = const bool.fromEnvironment('dart.vm.product')
          ? 'production'
          : 'development';

      // Release is auto-set on iOS/Android as "packageName@version+build"
      // Override if needed:
      // options.release = 'my-app@1.0.0+42';

      // Error sampling — reduce to drop a fraction of errors in high-volume production
      options.sampleRate = 1.0;

      // Tracing — lower to 0.1–0.2 in high-traffic production
      options.tracesSampleRate = 1.0;

      // Profiling — iOS and macOS only (alpha); relative to tracesSampleRate
      options.profilesSampleRate = 1.0;

      // Session Replay — iOS and Android only (SDK ≥9.0.0)
      options.replay.sessionSampleRate = 0.1;   // record 10% of all sessions
      options.replay.onErrorSampleRate = 1.0;   // always record error sessions

      // Privacy defaults — all text and images masked
      options.privacy.maskAllText = true;
      options.privacy.maskAllImages = true;

      // Structured logging (SDK ≥9.5.0)
      options.enableLogs = true;

      // Attachments
      options.attachScreenshot = true;          // screenshot on error
      options.attachViewHierarchy = true;       // widget tree on error

      // HTTP client
      options.captureFailedRequests = true;     // auto-capture HTTP errors
      options.maxRequestBodySize = MaxRequestBodySize.small;

      // Android specifics
      options.anrEnabled = true;                // ANR detection
      options.enableNdkScopeSync = true;        // sync scope to native
      options.enableTombstone = false;          // Android 12+ tombstone (opt-in)

      // Navigation (Time to Full Display — opt-in)
      options.enableTimeToFullDisplayTracing = true;
    },
    appRunner: () => runApp(SentryWidget(child: MyApp())),
  );
}

Navigation: Time to Full Display (TTFD)

TTID (Time to Initial Display) is always enabled. TTFD is opt-in:

dart
// Enable in options:
options.enableTimeToFullDisplayTracing = true;

Then report when your screen has loaded its data:

dart
// Option 1: Widget wrapper (marks TTFD when child first renders)
SentryDisplayWidget(child: MyWidget())

// Option 2: Manual API call (after async data loads)
await _loadData();
SentryFlutter.currentDisplay()?.reportFullyDisplayed();

For Each Agreed Feature

Walk through features one at a time. Load the reference file for each, follow its steps, then verify before moving on:

FeatureReferenceLoad when...
Error Monitoring${SKILL_ROOT}/references/error-monitoring.mdAlways (baseline)
Tracing & Performance${SKILL_ROOT}/references/tracing.mdAlways — navigation, HTTP, DB spans
Session Replay${SKILL_ROOT}/references/session-replay.mdiOS/Android user-facing apps
Profiling${SKILL_ROOT}/references/profiling.mdiOS/macOS performance-sensitive apps
Logging${SKILL_ROOT}/references/logging.mdStructured logging / log-trace correlation
Metrics${SKILL_ROOT}/references/metrics.mdCustom business metrics
Ecosystem Integrations${SKILL_ROOT}/references/ecosystem-integrations.mdHTTP clients, databases, GraphQL, state management

For each feature: Read ${SKILL_ROOT}/references/<feature>.md, follow steps exactly, verify it works.


Configuration Reference

Core SentryFlutter.init() Options
OptionTypeDefaultPurpose
dsnstring—Required. Project DSN. Env: SENTRY_DSN via --dart-define
environmentstring—e.g., "production", "staging". Env: SENTRY_ENVIRONMENT
releasestringAuto on iOS/Android"packageName@version+build". Env: SENTRY_RELEASE
diststring—Distribution identifier; max 64 chars. Env: SENTRY_DIST
sendDefaultPiiboolfalseInclude PII: IP address, user labels, widget text in replay
sampleRatedouble1.0Error event sampling (0.0–1.0)
maxBreadcrumbsint100Max breadcrumbs per event
attachStacktracebooltrueAuto-attach stack traces to messages
attachScreenshotboolfalseCapture screenshot on error (mobile/desktop only)
screenshotQualityenumhighScreenshot quality: full, high, medium, low
attachViewHierarchyboolfalseAttach JSON widget tree as attachment on error
debugbooltrue in debugVerbose SDK output. Never force true in production
diagnosticLevelenumwarningLog verbosity: debug, info, warning, error, fatal
enabledbooltrueDisable SDK entirely (e.g., for testing)
maxCacheItemsint30Max offline-cached envelopes (not supported on Web)
sendClientReportsbooltrueSend SDK health reports (dropped events, etc.)
reportPackagesbooltrueReport pubspec.yaml dependency list
reportSilentFlutterErrorsboolfalseCapture FlutterErrorDetails.silent errors
idleTimeoutDuration3000msAuto-finish idle user interaction transactions
Tracing Options
OptionTypeDefaultPurpose
tracesSampleRatedouble—Transaction sample rate (0–1). Enable by setting >0
tracesSamplerfunction—Per-transaction sampling; overrides tracesSampleRate
tracePropagationTargetsList—URLs to attach sentry-trace + baggage headers
propagateTraceparentboolfalseAlso send W3C traceparent header (SDK ≥9.7.0)
enableTimeToFullDisplayTracingboolfalseOpt-in TTFD tracking per screen
enableAutoPerformanceTracingbooltrueAuto-enable performance monitoring
enableUserInteractionTracingbooltrueCreate transactions for tap/click/long-press events
enableUserInteractionBreadcrumbsbooltrueBreadcrumbs for every tracked user interaction
Profiling Options
OptionTypeDefaultPurpose
profilesSampleRatedouble—Profiling rate relative to tracesSampleRate. iOS/macOS only
Native / Mobile Options
OptionTypeDefaultPurpose
autoInitializeNativeSdkbooltrueAuto-initialize native Android/iOS SDK layer
enableNativeCrashHandlingbooltrueCapture native crashes (NDK, signal, Mach exception)
enableNdkScopeSyncbooltrueSync Dart scope to Android NDK
enableScopeSyncbooltrueSync scope data to native SDKs
anrEnabledbooltrueANR detection (Android)
anrTimeoutIntervalint5000ANR timeout in milliseconds (Android)
enableWatchdogTerminationTrackingbooltrueOOM kill tracking (iOS)
enableTombstoneboolfalseAndroid 12+ native crash info via ApplicationExitInfo
attachThreadsboolfalseAttach all threads on crash (Android)
captureNativeFailedRequestsbool—Native HTTP error capture, independent of Dart client (iOS/macOS, v9.11.0+)
enableAutoNativeAppStartbooltrueApp start timing instrumentation (iOS/Android)
enableFramesTrackingbooltrueSlow/frozen frame monitoring (iOS/Android/macOS)
proguardUuidstring—Proguard UUID for Android obfuscation mapping
Session & Release Health Options
OptionTypeDefaultPurpose
enableAutoSessionTrackingbooltrueSession tracking for crash-free user/session metrics
autoSessionTrackingIntervalDuration30sBackground inactivity before session ends
Replay Options (options.replay)
OptionTypeDefaultPurpose
replay.sessionSampleRatedouble0.0Fraction of all sessions recorded
replay.onErrorSampleRatedouble0.0Fraction of error sessions recorded
Show full SKILL.md (783 more words)Show less
Replay Privacy Options (options.privacy)
Option / MethodDefaultPurpose
privacy.maskAllTexttrueMask all text widget content
privacy.maskAllImagestrueMask all image widgets
privacy.maskAssetImagestrueMask images from root asset bundle
privacy.mask<T>()—Mask a specific widget type and all subclasses
privacy.unmask<T>()—Unmask a specific widget type
privacy.maskCallback<T>()—Custom masking decision per widget instance
HTTP Options
OptionTypeDefaultPurpose
captureFailedRequestsbooltrue (Flutter)Auto-capture HTTP errors
maxRequestBodySizeenumneverBody capture: never, small, medium, always
failedRequestStatusCodesList[500–599]Status codes treated as failures
failedRequestTargetsList['.*']URL patterns to monitor
Hook Options
OptionTypePurpose
beforeSend(SentryEvent, Hint) → SentryEvent?Modify or drop error events. Return null to drop
beforeSendTransaction(SentryEvent) → SentryEvent?Modify or drop transaction events
beforeBreadcrumb(Breadcrumb, Hint) → Breadcrumb?Process breadcrumbs before storage
beforeSendLog(SentryLog) → SentryLog?Filter structured logs before sending
Environment Variables

Pass via --dart-define at build time:

VariablePurposeNotes
SENTRY_DSNData Source NameFalls back from options.dsn
SENTRY_ENVIRONMENTDeployment environmentFalls back from options.environment
SENTRY_RELEASERelease identifierFalls back from options.release
SENTRY_DISTBuild distributionFalls back from options.dist
SENTRY_AUTH_TOKENUpload debug symbolsNever embed in app — build tool only
SENTRY_ORGOrganization slugUsed by sentry_dart_plugin
SENTRY_PROJECTProject slugUsed by sentry_dart_plugin

Usage:

bash
flutter build apk --release \
  --dart-define=SENTRY_DSN=https://xxx@sentry.io/123 \
  --dart-define=SENTRY_ENVIRONMENT=production

Then in code:

dart
options.dsn = const String.fromEnvironment('SENTRY_DSN');
options.environment = const String.fromEnvironment('SENTRY_ENVIRONMENT', defaultValue: 'development');
Production Settings

Lower sample rates and harden config before shipping:

dart
Future<void> main() async {
  final isProduction = const bool.fromEnvironment('dart.vm.product');

  await SentryFlutter.init(
    (options) {
      options.dsn = const String.fromEnvironment('SENTRY_DSN');
      options.environment = isProduction ? 'production' : 'development';

      // Trace 10% of transactions in high-traffic production
      options.tracesSampleRate = isProduction ? 0.1 : 1.0;

      // Profile 100% of traced transactions (profiling is always a subset)
      options.profilesSampleRate = 1.0;

      // Replay all error sessions, sample 5% of normal sessions
      options.replay.onErrorSampleRate = 1.0;
      options.replay.sessionSampleRate = isProduction ? 0.05 : 1.0;

      // Disable debug logging in production
      options.debug = !isProduction;
    },
    appRunner: () => runApp(SentryWidget(child: MyApp())),
  );
}
Default Auto-Enabled Integrations

These are active with no extra config when you call SentryFlutter.init():

IntegrationWhat it does
FlutterErrorIntegrationCaptures FlutterError.onError framework errors
RunZonedGuardedIntegrationCatches unhandled Dart exceptions in runZonedGuarded
NativeAppStartIntegrationApp start timing (iOS/Android)
FramesTrackingIntegrationSlow/frozen frames (iOS/Android/macOS)
NativeUserInteractionIntegrationUser interaction breadcrumbs from native layer
UserInteractionIntegrationDart-layer tap/click transactions (requires SentryWidget)
DeviceContextIntegrationDevice model, OS version, screen resolution
AppContextIntegrationApp version, build number, bundle ID
ConnectivityIntegrationNetwork connectivity change breadcrumbs
HttpClientIntegrationAuto-instrument Dart http requests
SdkIntegrationSDK metadata tagging
ReleaseIntegrationAuto-set release on iOS/Android from package info

Verification

After setup, test that Sentry is receiving events:

dart
// Add a test button somewhere visible during development:
ElevatedButton(
  onPressed: () {
    throw Exception('Sentry test error!');
  },
  child: const Text('Test Sentry Error'),
)

// Or capture manually:
ElevatedButton(
  onPressed: () {
    Sentry.captureMessage('Sentry test message', level: SentryLevel.info);
  },
  child: const Text('Test Sentry Message'),
)

// Test structured logging:
ElevatedButton(
  onPressed: () {
    Sentry.logger.info('Test log from Flutter app');
  },
  child: const Text('Test Sentry Log'),
)

Check the Sentry dashboard:

  • Issues → test error should appear within seconds
  • Traces → look for a navigation transaction with child spans
  • Replays → session recording visible after app interaction (iOS/Android only)
  • Logs → structured log entries if enableLogs: true

⚠️ Platform limitations in debug mode:

  • Native crashes, session replay, slow/frozen frames, and app start metrics only fully work in release builds on iOS/Android
  • Run flutter run --release or use a real device/emulator to test native features
  • Debug mode uses the Dart VM with JIT compilation — some native integrations behave differently

After completing Flutter setup, check for a backend missing Sentry coverage:

bash
# Adjacent backend directories
ls ../backend ../server ../api 2>/dev/null
cat ../go.mod 2>/dev/null | head -3
cat ../requirements.txt ../pyproject.toml 2>/dev/null | head -3
cat ../Gemfile 2>/dev/null | head -3
ls ../backend/package.json ../server/package.json 2>/dev/null

If a backend exists without Sentry, suggest the matching skill:

DetectedSuggest skill
Go backend (go.mod)sentry-go-sdk
Python backend (requirements.txt, pyproject.toml)sentry-python-sdk
Ruby backend (Gemfile)sentry-ruby-sdk
Node.js backendsentry-node-sdk
.NET backend (*.csproj)sentry-dotnet-sdk
React / Next.js websentry-react-sdk / sentry-nextjs-sdk

Distributed tracing — if a backend skill is added, configure tracePropagationTargets in Flutter to propagate trace context to your API:

dart
options.tracePropagationTargets = ['api.myapp.com', 'localhost'];
options.propagateTraceparent = true; // also send W3C traceparent header

This links mobile transactions to backend traces in the Sentry waterfall view.


Troubleshooting

IssueSolution
Events not appearing in SentrySet options.debug = true — SDK logs to Flutter console; verify DSN is correct
SentryFlutter.init throwsEnsure main() is async and you await SentryFlutter.init(...)
Stack traces unreadable in SentryUpload debug symbols with sentry_dart_plugin; build with --obfuscate --split-debug-info
Stack traces missing on WebBuild with --source-maps and run dart run sentry_dart_plugin to upload
Native crashes not capturedConfirm enableNativeCrashHandling: true; test in release mode, not debug
Session replay not recordingiOS/Android only; confirm SentryWidget wraps root; check replay.onErrorSampleRate
Replay shows blank screensConfirm SentryWidget(child: MyApp()) is outermost widget; not inside navigator
Profiling not workingiOS and macOS only (alpha); confirm tracesSampleRate > 0 is set first
Navigation not trackedAdd SentryNavigatorObserver() to navigatorObservers; name all routes
GoRouter routes unnamedAdd name: to all GoRoute entries — unnamed routes are tracked as null
TTFD never reportsCall SentryFlutter.currentDisplay()?.reportFullyDisplayed() after data loads, or wrap with SentryDisplayWidget
sentry_dart_plugin auth errorSet SENTRY_AUTH_TOKEN env var instead of hardcoding in pubspec.yaml
Android ProGuard mapping missingEnsure --extra-gen-snapshot-options=--save-obfuscation-map=... flag is set
iOS dSYM not uploadedsentry_dart_plugin handles this; check upload_debug_symbols: true in pubspec.yaml sentry: block
pub get fails: Dart SDK too oldsentry_flutter ≥9.0.0 requires Dart ≥3.5.0; run flutter upgrade
Hot restart crashes on Android debugKnown issue (fixed in SDK ≥9.9.0); upgrade if on older version
ANR detection too aggressiveIncrease anrTimeoutInterval (default: 5000ms)
Too many transactions in dashboardLower tracesSampleRate to 0.1 or use tracesSampler to drop health checks
beforeSend not firing for native crashesExpected — beforeSend intercepts only Dart-layer events; native crashes bypass it
Crons not availableThe Flutter/Dart SDK does not support Sentry Crons; use a server-side SDK instead
SentryWidget warning in testsWrap test widget with SentryFlutter.init() in setUpAll, or use enabled: false
Firebase Remote Config: Linux/Windowssentry_firebase_remote_config not supported on Linux/Windows (Firebase limitation)
Isar tracing on Websentry_isar does NOT support Web (Isar does not support Web)

© getsentry, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 7 other files (references) in skills-legacy/sentry-flutter-sdk of getsentry/sentry-for-ai.

  • SKILL.md
  • references/ecosystem-integrations.md
  • references/error-monitoring.md
  • references/logging.md
  • references/metrics.md
  • references/profiling.md
  • references/session-replay.md
  • references/tracing.md

Open the folder on GitHubat commit d8fd106

Compare with similar skills

Sentry Flutter SDK next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Sentry Flutter SDK compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Sentry Flutter SDK this skillgetsentry/sentry-for-ai268—~7.1kAutomated safety check: PassApache-2.0
flutter_soloud Setupalnitak/flutter_soloud424—~3.6kAutomated safety check: NotesMIT
Fkit SetupJoker-x-dev/FlutterKit127—~720Automated safety check: PassMIT
Flutter Embedding Native Viewsbtwld/superdeck129—~2.1kAutomated safety check: PassBSD-3-Clause
Flutter Appccplugins/awesome-claude-code-plugins967—~1.1kAutomated safety check: NotesApache-2.0
RunQuisApp/flutter_contacts111—~252Automated safety check: NotesMIT

Similar skills

  • flutter_soloud Setup

    alnitak/flutter_soloud

    Walks through adding the flutter_soloud audio engine to a Flutter app, with per-platform setup, initialization, binary-size and logging options, and output device switching.

    424 GitHub stars~3.6k tokensUpdated today
    MobileAuto-check: notes
  • Fkit Setup

    Joker-x-dev/FlutterKit

    将 FlutterKit 脚手架初始化为新的应用项目,统一修改应用显示名称、Dart 包名、Android Application ID、Apple Bundle ID、Linux/Windows 标识、Web 名称、运行时品牌文案、Logo、桌面图标和启动页。用户拉取模板后要求改名、改包名、替换品牌资源或完成首次项目配置时使用。

    127 GitHub stars~720 tokensUpdated 2 mo ago
    MobileAuto-check passed
  • Embeds native Android, iOS, or macOS views into a Flutter app.

    129 GitHub stars~2.1k tokensUpdated 9 days ago
    MobileAuto-check passed
  • Flutter App

    ccplugins/awesome-claude-code-plugins

    Bootstrap a new Flutter mobile app with clean architecture, Riverpod, FVM-pinned SDK, current packages, and no deprecated APIs.

    967 GitHub stars~1.1k tokensUpdated 1 mo ago
    MobileAuto-check: notes
  • Run

    QuisApp/flutter_contacts

    Run the example app on physical devices. An agent skill from QuisApp/flutter_contacts.

    111 GitHub stars~252 tokensUpdated 4 days ago
    MobileAuto-check: notes
  • Fkit Native

    Joker-x-dev/FlutterKit

    管理 FlutterKit 多端运行时资源、应用图标、原生启动页、Android/iOS/Web/桌面端配置和发布构建。用户要求生成图标、启动页、FlutterGen 资源、同步原生底座、排查原生缓存或执行多端打包时使用。

    127 GitHub stars~285 tokensUpdated 2 mo ago
    MobileAuto-check passed

More from getsentry/sentry-for-ai

All 32 skills in this repo
  • Sentry Elixir SDK

    getsentry/sentry-for-ai

    Official

    Full Sentry SDK setup for Elixir. An agent skill from getsentry/sentry-for-ai.

    268 GitHub stars~3.5k tokensUpdated today
    Auto-check passed
  • Sentry Go SDK

    getsentry/sentry-for-ai

    Official

    Full Sentry SDK setup for Go. An agent skill from getsentry/sentry-for-ai.

    268 GitHub stars~3.2k tokensUpdated today
    Auto-check passed
  • Sentry Nextjs SDK

    getsentry/sentry-for-ai

    Official

    Full Sentry SDK setup for Next.js. An agent skill from getsentry/sentry-for-ai.

    268 GitHub stars~4.7k tokensUpdated today
    Auto-check: notes
  • Sentry Php SDK

    getsentry/sentry-for-ai

    Official

    Full Sentry SDK setup for PHP. An agent skill from getsentry/sentry-for-ai.

    268 GitHub stars~3.7k tokensUpdated today
    Auto-check: notes
  • Sentry Python SDK

    getsentry/sentry-for-ai

    Official

    Full Sentry SDK setup for Python. An agent skill from getsentry/sentry-for-ai.

    268 GitHub stars~4.1k tokensUpdated today
    Auto-check passed
  • Sentry React Router Framework SDK

    getsentry/sentry-for-ai

    Official

    Full Sentry SDK setup for React Router Framework mode. An agent skill from getsentry/sentry-for-ai.

    268 GitHub stars~3.8k tokensUpdated today
    Auto-check: notes

Categories

Questions about Sentry Flutter SDK

What does Sentry Flutter SDK do?

Full Sentry SDK setup for Flutter and Dart. An agent skill from getsentry/sentry-for-ai. Sentry Flutter SDK is an agent skill from getsentry/sentry-for-ai, published by the product's own GitHub organization. Full Sentry SDK setup for Flutter and Dart.

When should I use Sentry Flutter SDK?

Sentry Flutter SDK fits situations like: asked to add Sentry to Flutter; install sentryflutter; setup Sentry in Dart; configure error monitoring.

How do I install Sentry Flutter SDK in Claude Code?

Run `npx skills add getsentry/sentry-for-ai --skill sentry-flutter-sdk -a claude-code`. Or copy the skill folder (skills-legacy/sentry-flutter-sdk in getsentry/sentry-for-ai) into .claude/skills/sentry-flutter-sdk in your project. Claude Code loads it when a task matches its description.

How do I install Sentry Flutter SDK in Codex?

Run `npx skills add getsentry/sentry-for-ai --skill sentry-flutter-sdk -a codex`. Or copy the skill folder (skills-legacy/sentry-flutter-sdk in getsentry/sentry-for-ai) into .agents/skills/sentry-flutter-sdk in your project. Codex loads it when a task matches its description.

Can I use Sentry Flutter SDK in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add getsentry/sentry-for-ai --skill sentry-flutter-sdk -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/sentry-flutter-sdk, .gemini/skills/sentry-flutter-sdk, .github/skills/sentry-flutter-sdk and .opencode/skills/sentry-flutter-sdk in your project.

What does Sentry Flutter SDK need to run?

Going by SKILL.md and its folder, Sentry Flutter SDK needs the command-line tools its instructions call (flutter and dart) and credentials named SENTRY_AUTH_TOKEN. Our summary lists: A credential in YOUR_AUTH_TOKEN; A credential in SENTRY_AUTH_TOKEN.

Does Sentry Flutter SDK access the network?

SKILL.md names 2 domains. In commands or code: sentry.io; the agent is likely to contact it when it follows the instructions. As links in the text: docs.sentry.io. This is read from the text; nothing was executed.

Is Sentry Flutter SDK safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Sentry Flutter SDK use?

Sentry Flutter SDK is published under the Apache-2.0 licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Sentry Flutter SDK use?

About 7.1k tokens (SKILL.md is roughly 28k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 17k tokens, read only when the agent opens those files.

What are the alternatives to Sentry Flutter SDK?

Skills that share tags, products or a category with Sentry Flutter SDK: flutter_soloud Setup (alnitak/flutter_soloud, 424 stars), Fkit Setup (Joker-x-dev/FlutterKit, 127 stars), Flutter Embedding Native Views (btwld/superdeck, 129 stars) and Flutter App (ccplugins/awesome-claude-code-plugins, 967 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Sentry Flutter SDK?

getsentry (a GitHub organization, an official publisher) maintains it in getsentry/sentry-for-ai, which has 268 GitHub stars. The repository holds 32 skills in this directory. The repository was last updated on October 7, 2026.

Source: getsentry/sentry-for-ai on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.