# Watch a Flutter app

> Add Relia to a Flutter app with one package, so sessions, screens, taps, API calls and crashes on Android and iOS show up in Relia, joined to your backend.

Section: Set up your stack · Page: https://tryrelia.com/docs/flutter-setup · Last checked against the product: 2026-11-19

Relia watches your Flutter app the way it watches your website: what people did, what broke, and which API call came just before it. When a backend change breaks one version of your app, the incident shows both sides. To have your AI assistant do the setup instead, see [Set up Relia with your AI assistant](https://tryrelia.com/docs/setup-with-ai-assistant.md).

## Before you start

- A Relia account ([Create your account](https://tryrelia.com/docs/create-account.md)).
- A Flutter app (Flutter 3.19 or newer).
- Your project's id and key. In Relia, open your project and click **Setup Guide & SDK**, then pick **Flutter**. The code shown there already holds your id and your key (the key starts with `relia_live_`).

## Steps

1. **Install the package** in your app's folder:

   ```bash
   flutter pub add relia_flutter
   ```

   Or run `npx relia-sdk@latest init` there: it finds the Flutter app, adds the package and edits `lib/main.dart` for you.

2. **Start Relia in `lib/main.dart`**, before `runApp`:

   ```dart
   import 'package:flutter/material.dart';
   import 'package:relia_flutter/relia_flutter.dart';

   Future<void> main() async {
     WidgetsFlutterBinding.ensureInitialized();
     await Relia.init(const ReliaOptions(projectId: 'your-project-id', key: 'relia_live_…', serviceName: 'shop-app'));
     runApp(Relia.wrap(const MyApp()));
   }
   ```

   Start it before the app creates its HTTP clients: every call made with the `http` package, dio or `HttpClient` after it is recorded, with no other change.

3. **Name your screens.** Add the observer to your app:

   ```dart
   MaterialApp(navigatorObservers: [Relia.navigatorObserver], …)
   // or with go_router
   GoRouter(observers: [Relia.navigatorObserver], …)
   ```

   A screen is the route's **name**, never its arguments, so give your routes names.

4. **See a crash arrive.** Add a button that calls `Relia.testCrash()`, press it, and open **Mobile app** in Relia. The crash is there within a minute, with the steps that led to it. Remove the button afterwards.

## What counts as a crash

A widget that fails to build or draw shows the person a broken screen, so it counts against **crash-free people**. Other errors your app didn't catch (a failed call in the background, an image that didn't load) are listed as crash groups too, but don't lower crash-free people.

On Android, Relia also catches what happens outside Dart: a Java or Kotlin exception (often from a plugin), the app freezing ("app not responding"), a native crash, and Android closing the app for memory. These arrive the next time the app is opened, with the screen and the steps before them. Nothing to set up.

## Readable crashes

A normal `flutter build` keeps your function names and lines, so a crash points at `lib/…:line` straight away, with nothing to upload. Builds made with `--obfuscate --split-debug-info` print addresses only, which Relia can't read yet.

## Join the app to your backend

```dart
ReliaOptions(projectId: 'your-project-id', key: 'relia_live_…', propagateTo: ['api.yourdomain.com'])
```

Calls to the hosts you list carry a `traceparent` header, so one incident shows the phone and the server. Third-party APIs never get it.

## Who your users are

After sign-in: `Relia.identify(user.id, {'email': user.email, 'name': user.name, 'plan': user.plan})`. On sign-out: `Relia.reset()`. Nothing about the person is sent without it.

## What it records

- **Screens:** the route's name. Dialogs and bottom sheets are not screens.
- **Taps:** the button's Key, else its tooltip or label, else its widget type. Its text only with `captureText: true`, and never from a text field.
- **API calls:** method, address without its query, status and duration. Calls that fail because the phone was offline, or that the app cancelled, are never counted as failures.
- **Your app's version and build**, the phone model, system version and network type.

It never records typed text, screen pixels, a URL's query or an advertising id. Your own error handlers, Crashlytics and Sentry keep working: Relia passes every error on.

## What it costs

**300 units per device per month.** Each phone or tablet that opens your app counts once in a calendar month, however many times it is used that month. Crashes are free. See [Plans and billing](https://tryrelia.com/docs/plans-and-billing.md).

## Not yet

Native iOS crashes and the app start time on iOS. Sessions, screens, taps, API calls and Dart crashes already work on iOS.

---
All Relia docs for AI assistants: https://tryrelia.com/llms.txt (index) · https://tryrelia.com/llms-full.txt (everything in one file)
