Flutter SDK
Veil RASP for Flutter — wraps the native Android and iOS SDKs via platform channels.
1
Add the SDK
Add the native SDKs for each platform using the Android and iOS guides, then copy veil_sdk.dart into your project.
2
Initialize
Call at the top of main() before runApp(). Use platform-specific credentials from your Veil dashboard.
import 'dart:io';
import 'veil_sdk.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await VeilSDK.initialize(
clientId: 'your-client-id',
appId: Platform.isAndroid ? 'android-app-id' : 'ios-app-id',
appName: 'My App',
apiKey: Platform.isAndroid ? 'td_live_android_key' : 'td_live_ios_key',
policy: ThreatPolicy.warnOnly,
);
runApp(const MyApp());
}3
Choose a policy
Control how the SDK reacts when threats are detected.
| Policy | Behaviour |
|---|---|
| ThreatPolicy.silent | Detect silently — no UI shown |
| ThreatPolicy.warnOnly | Show dismissible warning (default) |
| ThreatPolicy.blockOnHigh | Block app on high severity threats |
| ThreatPolicy.blockOnCritical | Block app on critical threats only |
Need full API documentation?
Complete reference, threat coverage, and compliance guides are available after onboarding.