Session Replay: Flutter SDK Setup
Add screenshot-based session replay to your Flutter app with the scrywatch_replay package (Beta) — install, initialize, and gate capture behind consent.
Session Replay: Flutter SDK Setup
Note:
scrywatch_replayis a Beta / Preview package. The API below is the current beta surface and may change before general availability. Native iOS and Android SDKs are not available yet.
What you’ll need
- A ScryWatch project API key — from the dashboard, go to Settings → API keys (see API Keys & Settings)
- Flutter 3.0+ and Dart 3.0+
- Familiarity with your app’s existing consent/opt-in flow, if you have one
Step 1: Add the dependency
Add scrywatch_replay to your app:
flutter pub add scrywatch_replay
Preview release.
scrywatch_replayis published on pub.dev as a preview (0.1.0) — the API may evolve before 1.0. Pin the version inpubspec.yaml(scrywatch_replay: ^0.1.0) if you want to control upgrades.
Step 2: Initialize the SDK
Call ScrywatchReplay.init before runApp, in your main():
import 'package:flutter/material.dart';
import 'package:scrywatch_replay/scrywatch_replay.dart';
void main() {
ScrywatchReplay.init(
apiKey: '<PROJECT_API_KEY>',
endpoint: 'https://api.scrywatch.com',
);
runApp(const MyApp());
}
Replace <PROJECT_API_KEY> with the key from Settings → API keys in the ScryWatch dashboard.
Step 3: Gate capture behind consent
No frames are captured until you explicitly grant consent. Nothing is recorded, buffered, or uploaded before this call:
// After your app's own consent/opt-in flow completes:
ScrywatchReplay.setConsent(true);
If a user opts out later — for example from a privacy settings screen — revoke consent the same way:
ScrywatchReplay.setConsent(false);
Once consent is revoked, capture stops immediately and no further frames are uploaded.
Step 4: That’s it
With init called and consent granted, capture is automatic — the SDK handles screen capture, on-device masking, and upload for you. There’s no manual “start recording” call and nothing to flush.
To control what’s masked, tag sensitive elements with ScrywatchTag and decide whether that tag is masked from the dashboard — no app release required. For hard in-code rules, use ScrywatchMask and ScrywatchReveal. See Masking & Privacy for the full API and the Blocklist/Strict modes.
You’re done
You now know how to:
- Add
scrywatch_replayto a Flutter app - Initialize the SDK with your project API key
- Gate capture behind explicit user consent, and honor opt-out
Related docs
- Masking & Privacy — the Blocklist/Strict masking modes and the
ScrywatchTag/ScrywatchMask/ScrywatchRevealwidgets - Viewing Replays — where captured sessions show up in the dashboard