Skip to main content

App Check

What does it do?#

App Check helps protect your backend resources (such as Cloud Storage) from abuse (such as billing fraud or phishing).

With App Check, devices running your app will use an app identity attestation provider to certify it is indeed your authentic app, and may also check that it’s running on an authentic, untampered device. This certification is attached to every request your app makes to your Firebase backend resources.

App Check currently supports Cloud Storage, Realtime Database, and Cloud Functions, with more Firebase products coming soon.

Note: App Check may not protect against certain abuse vectors when paired with a CDN.

[Learn more on the Firebase documentation].

Installation#

caution

FlutterFire App Check is an early access preview plugin; APIs may change in a future release.

Ensure you're using the Flutter stable channel:

$ flutter channel stable

If your app is mixing legacy and null-safe packages, use the --no-sound-null-safety flag:

$ flutter run --no-sound-null-safety

For legacy package imports, place the following ignore comment to hide Dart analyzer warnings:

// ignore: import_of_legacy_library_into_null_safe
import 'package:firebase_app_check/firebase_app_check.dart';

1. Add dependency#

Add the firebase_app_check dependency to your projects pubspec.yaml file:

pubspec.yaml
dependencies:
flutter:
sdk: flutter
firebase_core: "^1.4.0"
firebase_app_check: "^N/A"

2. Download dependency#

$ flutter pub get

3. (Web Only) Add the SDK#

If using FlutterFire on the web, add the firebase-app-check JavaScript SDK to your index.html file:

web/index.html
<html>
...
<body>
<script src="https://www.gstatic.com/firebasejs/8.6.1/firebase-app.js"></script>
<script src="https://www.gstatic.com/firebasejs/8.6.1/firebase-app-check.js"></script>
</body>
</html>

4. Rebuild your app#

Once complete, rebuild your Flutter application:

$ flutter run

Next Steps#

Once installed, you're ready to start using App Check in your Flutter Project. View the Usage documentation to get started.