From app-gtm-release
Configure Firebase App Check and other security measures for Flutter apps before launch. Use this skill when the user asks about App Check, Play Integrity, App Attest, DeviceCheck, API protection, preventing abuse, securing Firebase services, attestation providers, or protecting backend APIs from unauthorized clients. Also triggers on: 'protect my API', 'App Check setup', 'prevent scraping', 'verify legitimate app', or 'secure Firebase'.
How this skill is triggered — by the user, by Claude, or both
Slash command
/app-gtm-release:app-securityThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
This skill covers security measures that should be in place before a production launch, with Firebase App Check as the primary defense against API abuse.
This skill covers security measures that should be in place before a production launch, with Firebase App Check as the primary defense against API abuse.
App Check verifies that requests to your backend and Firebase services come from your legitimate app running on an authentic, untampered device. It blocks requests from:
App startup
└─ App Check SDK requests attestation from platform provider
├─ Android: Play Integrity API
├─ iOS: App Attest (iOS 14+) or DeviceCheck
└─ Web: reCAPTCHA Enterprise
└─ Provider returns attestation token
└─ App Check exchanges token for App Check token
└─ Token attached to Firebase/backend requests
└─ Firebase/backend verifies token
# pubspec.yaml
dependencies:
firebase_app_check: ^0.3.0
import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_app_check/firebase_app_check.dart';
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp();
await FirebaseAppCheck.instance.activate(
androidProvider: AndroidProvider.playIntegrity,
appleProvider: AppleProvider.appAttest,
);
runApp(MyApp());
}
During development, use the debug provider to avoid attestation failures on emulators:
// Only in debug builds
await FirebaseAppCheck.instance.activate(
androidProvider: AndroidProvider.debug,
appleProvider: AppleProvider.debug,
);
The debug provider outputs a debug token to the console. Register this token in Firebase Console:
Until you enforce App Check, it runs in audit mode (monitors but doesn't block):
Enforce one service at a time and monitor for a few days before enabling the next.
| Provider | Platform | Device support | Strength |
|---|---|---|---|
| Play Integrity | Android | Android 5.0+ with Play Services | Strong — Google's attestation |
| App Attest | iOS | iOS 14.0+ | Strong — hardware-based |
| DeviceCheck | iOS | iOS 11.0+ | Moderate — device-level, not app-level |
| Debug | All | Development only | None — for testing only |
Recommended setup:
AndroidProvider.playIntegrityAppleProvider.appAttest (falls back to DeviceCheck on older devices)If you have a custom backend (not just Firebase services), verify App Check tokens server-side:
// Node.js backend
const { getAppCheck } = require('firebase-admin/app-check');
async function verifyAppCheckToken(req, res, next) {
const token = req.headers['x-firebase-appcheck'];
if (!token) {
return res.status(401).json({ error: 'Missing App Check token' });
}
try {
await getAppCheck().verifyToken(token);
next();
} catch (error) {
return res.status(401).json({ error: 'Invalid App Check token' });
}
}
--obfuscate --split-debug-info)kDebugMode checks, debug providers removed)--dart-define or env file injection)flutter_secure_storage, not shared_preferences)print() and logging statements)For API security in production:
<!-- android/app/src/main/res/xml/network_security_config.xml -->
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<base-config cleartextTrafficPermitted="false">
<trust-anchors>
<certificates src="system" />
</trust-anchors>
</base-config>
<!-- Allow cleartext only for local development -->
<domain-config cleartextTrafficPermitted="true">
<domain includeSubdomains="true">10.0.2.2</domain>
<domain includeSubdomains="true">localhost</domain>
</domain-config>
</network-security-config>
Reference in AndroidManifest.xml:
<application
android:networkSecurityConfig="@xml/network_security_config"
...>
ATS enforces HTTPS by default on iOS. If you need exceptions (not recommended for production):
<!-- ios/Runner/Info.plist -->
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<false/>
<!-- Only if needed for specific domains -->
<key>NSExceptionDomains</key>
<dict>
<key>localhost</key>
<dict>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
</dict>
</dict>
</dict>
npx claudepluginhub dojocodinglabs/app-gtm-release-toolkit --plugin app-gtm-releaseProvides UI/UX resources: 50+ styles, color palettes, font pairings, guidelines, charts for web/mobile across React, Next.js, Vue, Svelte, Tailwind, React Native, Flutter. Aids planning, building, reviewing interfaces.
Fetches up-to-date documentation from Context7 for libraries and frameworks like React, Next.js, Prisma. Use for setup questions, API references, and code examples.