Skip to main content
RapidDev - Software Development Agency
flutterflow-integrationsCustom Action (Dart)

Sentry

Connect FlutterFlow to Sentry using a Dart Custom Action that adds the sentry_flutter pub.dev package and calls SentryFlutter.init() with your project's DSN. This is a Custom Code integration — not an API Call — and events only appear in Sentry when you run the app on a real device or web build, not in the FlutterFlow canvas preview. The DSN is a client-side ingestion key; any Sentry REST API token for reading issues must be proxied server-side.

What you'll learn

  • Why Sentry is a Custom Action integration (not an API Call) and what that means for testing in FlutterFlow
  • How to add the sentry_flutter pub.dev package as a Custom Code dependency in FlutterFlow
  • How to write a Dart initSentry Custom Action and trigger it at app launch
  • How to capture test exceptions to verify events arrive in your Sentry project dashboard
  • How to optionally display Sentry issues in-app using the Sentry REST API through a backend proxy
Book a free consultation
4.9Clutch rating
600+Happy partners
17+Countries served
190+Team members
Intermediate18 min read30 minutesDevOps & ToolsLast updated July 2026RapidDev Engineering Team
TL;DR

Connect FlutterFlow to Sentry using a Dart Custom Action that adds the sentry_flutter pub.dev package and calls SentryFlutter.init() with your project's DSN. This is a Custom Code integration — not an API Call — and events only appear in Sentry when you run the app on a real device or web build, not in the FlutterFlow canvas preview. The DSN is a client-side ingestion key; any Sentry REST API token for reading issues must be proxied server-side.

Quick facts about this guide
FactValue
ToolSentry
CategoryDevOps & Tools
MethodCustom Action (Dart)
DifficultyIntermediate
Time required30 minutes
Last updatedJuly 2026

Add Real Crash Monitoring to Your FlutterFlow App with Sentry

When you publish a FlutterFlow app to the App Store or Play Store, you lose visibility into what happens after users install it. Users rarely report bugs; they just delete the app. Sentry solves this by automatically capturing every unhandled exception, with a full stack trace, device context, and user information, and sending it to your Sentry project dashboard where you can triage, assign, and track resolution. For a FlutterFlow founder with no mobile background, Sentry is the fastest path to knowing when and why your app is crashing in production.

The important distinction with this integration is that Sentry does not work like a REST API you call from a button. It is a monitoring SDK you initialize once when the app starts, and it then runs silently in the background, intercepting Flutter's error handlers automatically. In FlutterFlow, the way to do this is through a Custom Action — a snippet of Dart code you write directly in the FlutterFlow editor, with the sentry_flutter package declared as a dependency. FlutterFlow compiles this Dart code into the final app binary when you run or export the project.

The FlutterFlow canvas and preview mode do not execute Dart Custom Actions. This means you will not see Sentry events until you use FlutterFlow's Run mode (which compiles and runs the web version of your app) or test on a physical device via a downloaded APK or TestFlight build. This is a normal constraint of FlutterFlow's architecture — your custom code is real and correct, it simply requires a compiled environment to execute. Sentry offers a Developer-tier free plan that covers approximately 5,000 errors per month, which is more than sufficient for most apps during early growth. Check current plan details on sentry.io as pricing evolves.

Integration method

Custom Action (Dart)

Sentry is not a data API you call from screens — it is crash and error monitoring you initialize once when the app starts. In FlutterFlow, this means adding the sentry_flutter pub.dev package as a Custom Code dependency, writing a Dart Custom Action that calls SentryFlutter.init() with your project's DSN, and triggering that action on the root page at app launch. From that point forward, Sentry automatically captures any unhandled exceptions and can receive manually reported errors via Sentry.captureException(). The DSN is a client-side ingestion key designed to be in the app; the Sentry REST API token for reading issues in dashboards is a real secret and must be handled through a backend proxy if you display issue data in-app.

Prerequisites

  • A Sentry account (free Developer plan available at sentry.io) with a Flutter project created
  • The DSN string from your Sentry project's Settings > Client Keys (DSN) page
  • A FlutterFlow project (Starter plan or higher for Custom Code access)
  • A physical device or web build environment for testing — Custom Actions do not run in the FlutterFlow canvas preview
  • A Firebase or Supabase project if you want to display Sentry issues in-app via the REST API (optional)

Step-by-step guide

1

Create a Sentry Flutter project and copy the DSN

Log in to sentry.io and navigate to Projects in the left sidebar. Click Create Project and select Flutter from the platform list (it is under Mobile). Give the project a name that matches your FlutterFlow app — for example, MyApp-Production. Click Create Project. Sentry will display a getting-started page with a code snippet. You do not need to follow the full Flutter SDK setup instructions from this page because FlutterFlow handles dependency management differently — what you need is the DSN string, which looks like: https://abc123@o456.ingest.sentry.io/789. Copy this value and paste it into a secure note. The DSN is a client-side ingestion key — it is designed to live inside mobile apps and be shipped to devices, so it is not a high-security secret like a database password. However, it is unique to your project and theoretically lets others submit events to your quota, so treat it with basic discretion (do not post it in public repos). To find the DSN again later: go to your Sentry project's Settings > Client Keys (DSN). Sentry also lets you set up Alerts for new issues and error-rate thresholds — set up at least one email alert now so you receive a notification the first time a real crash event arrives. This confirms the integration is working before you ship to real users.

Pro tip: Create a separate Sentry project for each environment (production, staging) so testing errors do not pollute your production dashboard. Name them MyApp-Production and MyApp-Staging.

Expected result: You have a Sentry Flutter project created and the DSN string copied. At least one issue alert is configured so you receive an email when the first event arrives.

2

Add the sentry_flutter dependency in FlutterFlow Custom Code

In FlutterFlow, navigate to Custom Code in the left navigation panel (the icon looks like angle brackets <>). Click the + Add button and choose Action. Name the action initSentry. In the Return Value section at the top, set it to Void (this action has no return value — it is a side-effect initialization). Now scroll down to the Dependencies section of the Custom Action editor. This is where you declare pub.dev packages that your Dart code will import. Click + Add Dependency. In the Package Name field enter sentry_flutter exactly as written (all lowercase, underscore). In the Version field, enter the latest stable version number — check pub.dev/packages/sentry_flutter for the current version. At the time of this writing a recent version is 8.x; enter the version without a caret prefix (FlutterFlow handles version constraints). Click Add. You should now see sentry_flutter listed under Dependencies in your Custom Action. This tells FlutterFlow's build system to include the package in the compiled app. Note that adding a dependency does not immediately break your canvas preview — dependencies only matter when the app compiles. If FlutterFlow shows a warning that the package cannot be resolved in preview mode, that is expected behavior for packages that use native platform channels. Do not add multiple Sentry packages. The sentry_flutter package already includes the core sentry SDK as a transitive dependency — you only need sentry_flutter.

Pro tip: Find the exact latest version of sentry_flutter at pub.dev/packages/sentry_flutter — look for the version number under 'Installing' tab. Using an outdated version may miss important fixes for Flutter 3.x.

Expected result: The initSentry Custom Action has sentry_flutter listed under its Dependencies section. The action is in a void/unsaved state waiting for the Dart code in the next step.

3

Write the initSentry Custom Action Dart code

In the Dart code editor of your initSentry Custom Action, paste the initialization code below. This code imports sentry_flutter, calls SentryFlutter.init() with an options callback that sets the DSN, and enables automatic performance monitoring and session tracking. The DSN is passed in as a parameter so it is not hardcoded in the action — you will set it when calling the action from the Action Flow. You need to declare one Action Parameter for the DSN string. Click + Add Parameter in the Parameters section of the Custom Action. Name it dsn, set the type to String, and mark it as required. This parameter appears in the {{ dsn }} placeholder in the code. After pasting the code, click the Compile button (or the checkmark icon) in the Custom Code editor. FlutterFlow compiles the Dart in its sandbox and shows errors or success. If you see 'Package not found' errors, the dependency declaration from the previous step has not propagated yet — wait a few seconds and try again. A successful compile shows a green check. If you see analyzer errors about the SentryFlutter class not being found, confirm the package name is sentry_flutter (not sentry or flutter_sentry) and the version number is correct. One important note: the SentryFlutter.init() call is async and must be awaited. The Custom Action itself needs to be marked as async (FlutterFlow adds async to Custom Actions automatically when you await inside them). If the action does not execute correctly at launch, check that the Action Flow on your root page awaits this action before doing anything else.

custom_action.dart
1// FlutterFlow Custom Action: initSentry
2// Dependencies: sentry_flutter (latest version)
3
4import 'package:sentry_flutter/sentry_flutter.dart';
5
6Future initSentry(String dsn) async {
7 await SentryFlutter.init(
8 (options) {
9 options.dsn = dsn;
10 // Enable automatic performance monitoring
11 options.tracesSampleRate = 1.0;
12 // Enable automatic session tracking
13 options.autoSessionTrackingInterval = const Duration(milliseconds: 30000);
14 // Capture Flutter framework errors automatically
15 options.enableAutoSessionTracking = true;
16 },
17 appRunner: () {}, // FlutterFlow manages the app runner
18 );
19
20 // Test: capture a test breadcrumb to confirm initialization
21 Sentry.addBreadcrumb(
22 Breadcrumb(
23 message: 'Sentry initialized successfully',
24 level: SentryLevel.info,
25 ),
26 );
27}

Pro tip: For production apps, set tracesSampleRate to a lower value like 0.2 (20% of transactions) to avoid consuming your Sentry performance quota too quickly. For initial testing, 1.0 (100%) is fine.

Expected result: The Custom Action compiles successfully with a green check in the FlutterFlow editor. The action shows dsn as a required String parameter in the Parameters section.

4

Trigger initSentry at app launch on the root page

Now wire the initSentry Custom Action to run when the app starts, before any other logic executes. In FlutterFlow, navigate to your app's entry screen — typically the page your app opens to first (often a splash screen, onboarding screen, or main navigation screen depending on your app structure). This should be the first page users see before any authentication check or content loads. Click on that page to select it. Open the Actions panel for the page itself (not any widget on the page) by clicking the lightning bolt icon in the top-right corner of the properties panel while the page is selected. Add an On Page Load action. In the Action Flow Editor that opens, click + Add Action. In the search box, type initSentry or scroll to find it under Custom Actions. Select it. FlutterFlow shows a field for the dsn parameter — paste your Sentry DSN string here. Because the DSN is not a high-security secret (it is designed to be in client apps), you can enter it directly in this field. If your app has authentication and users can reach multiple pages before the root page finishes loading, you may want to place this on the very first page that renders, using an On Page Load trigger that runs in the background without blocking the UI. Sentry initialization is fast (sub-100ms in most cases) but the await call means it must complete before the appRunner logic runs. IMPORTANT: Custom Actions do not execute in the FlutterFlow canvas preview or in the standard Test mode that runs in the browser. To verify the action runs, use FlutterFlow's Run mode (which builds and serves the web version of your app) or download an APK/IPA and test on a physical device. The next step covers sending a test exception to confirm events arrive in Sentry.

Pro tip: Place the initSentry action as the very first item in your On Page Load Action Flow — before authentication checks, before loading user data — so crash monitoring is active from the earliest possible moment in the app lifecycle.

Expected result: The root page's On Page Load Action Flow shows initSentry as the first action with the DSN parameter filled in. The canvas preview shows no errors (the action simply does not run in preview, which is expected).

5

Send a test exception and verify events in Sentry

With the initSentry action wired up, you need to confirm it actually works by sending a deliberate test error to Sentry. Add a temporary button to any screen in your app — something you can tap during testing that will not be visible to real users. In the button's action flow, add a Custom Action call. You will need a second simple Custom Action for this. Create another Custom Action named sendTestError with no parameters and the following code. This action manually captures an exception. Once testing is complete, you can remove this button and action, or keep the captureException call in your real error-handling logic. To actually test it: click Run in the FlutterFlow header bar. This builds and serves your app in web mode (requires a FlutterFlow paid plan or the built-in Run feature). Wait for the build to complete, then tap the test button in the running app. Open your Sentry project dashboard and navigate to Issues. A new issue titled 'Test error from FlutterFlow' should appear within about 30 seconds. If it does not appear after two minutes, check: (1) the DSN in your initSentry action matches the Sentry project exactly, (2) you are viewing the correct Sentry project, (3) the app was actually run via Run mode or a device, not the canvas preview. Alternatively, test with a physical device: export the APK from FlutterFlow (requires Dev mode or a paid plan), install it on an Android device, tap the test button, and check Sentry. For iOS, use TestFlight. Once you see the test error in Sentry, delete or disable the test button and keep only the production error handling logic.

custom_action.dart
1// FlutterFlow Custom Action: sendTestError
2// Dependencies: sentry_flutter (same package, already declared)
3
4import 'package:sentry_flutter/sentry_flutter.dart';
5
6Future sendTestError() async {
7 try {
8 // Deliberately throw an exception
9 throw Exception('Test error from FlutterFlow — Sentry integration check');
10 } catch (exception, stackTrace) {
11 await Sentry.captureException(
12 exception,
13 stackTrace: stackTrace,
14 hint: Hint.withMap({
15 'source': 'Manual test from FlutterFlow debug button'
16 }),
17 );
18 }
19}
20
21// For production error handling, wrap API calls or risky operations:
22// try {
23// final result = await myApiCall();
24// } catch (e, stackTrace) {
25// await Sentry.captureException(e, stackTrace: stackTrace);
26// // Show user-friendly error message
27// }

Pro tip: If you'd rather skip the Custom Code setup and have the Sentry integration built professionally, RapidDev's team builds FlutterFlow integrations like this every week — free scoping call at rapidevelopers.com/contact.

Expected result: A new issue named 'Test error from FlutterFlow' appears in your Sentry project's Issues dashboard within 30-60 seconds of tapping the test button in Run mode or on a physical device.

Common use cases

Crash monitoring for a FlutterFlow marketplace app before launch

A founder building a FlutterFlow marketplace app integrates Sentry before the first TestFlight release so that any crashes encountered by beta testers automatically appear in Sentry with stack traces and device metadata. The founder triages issues in the Sentry dashboard before going live on the App Store, fixing the highest-frequency crashes first.

FlutterFlow Prompt

Add Sentry crash monitoring to my FlutterFlow app so I receive error reports with stack traces when the app crashes on any user's device. Initialize Sentry when the app opens and capture any unhandled exception automatically.

Copy this prompt to try it in FlutterFlow

Error boundary for a business-critical data entry screen

A FlutterFlow business app has a screen where field staff enter time-sensitive data. The developer wraps this screen's submission logic in a try/catch and manually calls Sentry.captureException() so any data submission failure is immediately recorded in Sentry with the user's employee ID as context, even if the user does not notice the error.

FlutterFlow Prompt

On the data submission button's action, wrap the API call in error handling so that if it fails, the error is sent to Sentry with the current user ID and the form values that caused the failure.

Copy this prompt to try it in FlutterFlow

In-app error dashboard for a FlutterFlow internal admin tool

An admin FlutterFlow screen displays a list of recent Sentry issues for the app by calling the Sentry REST API (authenticated via a backend proxy). Internal operators can see unresolved crashes without opening the Sentry web app. This uses the optional API Call pattern on top of the Core Custom Action integration.

FlutterFlow Prompt

Build an admin screen that shows the 10 most recent unresolved Sentry issues for our app. Each item should display the error title, how many times it has occurred, and the last-seen date.

Copy this prompt to try it in FlutterFlow

Troubleshooting

No events appear in Sentry after tapping the test button in FlutterFlow preview

Cause: FlutterFlow's canvas preview and standard in-browser preview do not execute Dart Custom Actions. The initSentry and sendTestError actions simply do not run in preview mode, so no events are sent to Sentry.

Solution: Test Sentry exclusively via FlutterFlow's Run mode (click Run in the header bar, which compiles and serves the web app) or by downloading an APK/IPA and installing it on a physical device. Never expect Custom Action results from the canvas preview. Once you switch to Run mode and tap the test button, Sentry events should appear within 30-60 seconds.

'Package not found: sentry_flutter' or compile error when saving the Custom Action

Cause: The dependency was either not added in the Dependencies section, the package name was misspelled, or the version number format is incorrect (some versions require a specific Flutter SDK version to compile).

Solution: Go to Custom Code > your initSentry action > Dependencies section. Confirm sentry_flutter is listed exactly (all lowercase, underscore, no spaces). Verify the version number matches a stable release shown at pub.dev/packages/sentry_flutter. If you entered a version like ^8.0.0 with a caret, remove the caret — FlutterFlow handles version resolution and caret prefixes sometimes cause parse errors. Click Save and try compiling again.

Sentry events are missing for some crashes — errors happen but nothing appears in the dashboard

Cause: Either the event quota for the plan is exhausted (events are silently dropped when quota runs out), or the app crashed so catastrophically that Sentry did not have time to flush the event to its servers before the process died.

Solution: Check your Sentry project's Settings > Usage & Billing to see if the monthly error quota is consumed. If quota is exhausted, events are dropped until the billing period resets or you upgrade. For catastrophic crashes (native crashes, out-of-memory kills), Sentry captures the event on the next app launch rather than immediately — check Sentry's Issues with the filter 'Last seen: any' to find events that arrived after a restart. Ensure your plan limit matches your app's error volume.

The Sentry REST API returns 401 Unauthorized when called from a FlutterFlow API Call to read issues

Cause: The Sentry REST API (used for reading issues programmatically) requires a Bearer auth token from your Sentry account's API tokens page, not the DSN. The DSN is for the SDK ingestion endpoint only and does not grant access to the REST API.

Solution: To read issues via the Sentry REST API, generate an API token in Sentry under Settings > API > Auth Tokens with the project:read scope. This token is a true secret — do NOT put it in a FlutterFlow API Call header where it ships to client devices. Create a Firebase Cloud Function or Supabase Edge Function that holds this token and proxies REST API calls to https://sentry.io/api/0/. The FlutterFlow API Call targets your proxy, not Sentry directly.

Best practices

  • Initialize Sentry as the very first action in your app's On Page Load flow on the root page — this maximizes the window during which crashes are captured, including any that occur during subsequent initialization steps.
  • Keep the DSN in the Custom Action's parameter field rather than hardcoding it in the Dart code — this makes it easy to swap between production and staging DSNs without modifying the code.
  • Create separate Sentry projects for production and staging environments so test errors and deliberate test exceptions do not pollute your production issue queue.
  • Always test Sentry in FlutterFlow's Run mode or on a physical device — Custom Actions never execute in the canvas preview, and testing in preview gives a false sense that the integration is not working.
  • Set tracesSampleRate to a lower value (0.1–0.2) in production to preserve Sentry performance quota, especially if your app has high user volume; use 1.0 only during development.
  • Wrap critical operations (API calls, database writes, form submissions) in try/catch blocks and call Sentry.captureException() with contextual data (user ID, relevant input values) so errors are actionable when they appear in the dashboard.
  • If you display Sentry issues in-app for admin users, always route the Sentry REST API token through a Firebase Cloud Function or Supabase Edge Function proxy — this token grants read access to your entire Sentry organization and must never ship in the compiled app.
  • Set up Sentry alert rules before going live: at minimum, an alert for 'new issue' and an alert for 'error rate spike' so you receive proactive notifications rather than discovering crashes from user complaints.

Alternatives

Frequently asked questions

Why can't I configure Sentry in FlutterFlow's API Calls tab like other integrations?

Sentry is not a data API you call from screens — it is a monitoring SDK that runs inside your app. The sentry_flutter SDK hooks into Flutter's global error handlers, wraps the app's execution context, and sends crash data automatically. This requires compiled Dart code (a Custom Action), not an HTTP request from an API Calls group. Trying to configure Sentry in the API Calls tab would only let you make REST API calls to read issues — it would not add crash monitoring to your app.

Will Sentry work on both iOS and Android with one Custom Action?

Yes. The sentry_flutter package is a cross-platform Flutter package that works on iOS, Android, and web with a single implementation. You write one initSentry Custom Action and it compiles correctly for all three targets. For web builds, Sentry captures JavaScript errors in addition to Dart errors, since Flutter web compiles to JavaScript. Test on each target platform separately to confirm, because some native crash scenarios (out-of-memory on iOS vs Android) behave differently.

Is the Sentry DSN a secret I need to protect?

The DSN is a client-side ingestion key designed to live inside mobile apps. It is publicly visible to anyone who extracts the APK or IPA, and Sentry is aware of this. The main risk of a leaked DSN is that someone could submit fabricated events to your Sentry quota. Sentry mitigates this with rate limits and inbound data filters. Keep the DSN out of public source code repositories as good practice, but do not treat it with the same urgency as a database password or a Stripe secret key.

Can I add user context to Sentry events so I know which user experienced a crash?

Yes. Add a second Custom Action called setSentryUser that calls Sentry.configureScope() to attach user information (ID, email, username). Trigger this action after a successful login and before any screens where errors might occur. User context appears in the Sentry issue detail and makes it possible to contact affected users directly. Do not include sensitive data like passwords or payment information in user context.

How do I set up Sentry for both my staging and production FlutterFlow environments?

Create two Sentry projects (MyApp-Staging and MyApp-Production) in Sentry, each with its own DSN. In FlutterFlow, store the DSN as a parameter passed to initSentry. For a simple setup, use FlutterFlow's App Values to define a constant (SENTRY_DSN) and swap the value between your staging and production FlutterFlow projects. For a more robust approach, use FlutterFlow's environment-specific configuration if available on your plan, or maintain two separate FlutterFlow projects that share the same codebase via GitHub export.

RapidDev

Talk to an Expert

Our team has built 600+ apps. Get personalized help with your project.

Book a free consultation

Integrations are where projects stall

We wire FlutterFlow integrations like this one every week — auth, webhooks, edge cases included. Fixed-price builds from $13K, delivered in 6–10 weeks.

Talk to an integration engineer

We put the rapid in RapidDev

Need a dedicated strategic tech and growth partner? Discover what RapidDev can do for your business! Book a call with our team to schedule a free, no-obligation consultation. We'll discuss your project and provide a custom quote at no cost.