Flutter SDK Quickstart
Bring Hawcx to Flutter using our production iOS and Android SDKs.
Overview
The Hawcx Flutter SDK delivers the same passwordless experience that powers our native apps. The plugin delegates all crypto and secure storage to the production Hawcx iOS and Android SDKs while giving you a single Dart API for authentication.
Hawcx Technology
One-click intelligent authentication that automatically determines user context
Contextual Intelligence
No more "Sign Up" vs "Sign In" confusion - just one smart entry point
Seamless Cross-Platform
Hawcx maintains user context across all devices and platforms
Enterprise-Grade Security
Production iOS cryptography and secure storage surfaced to Flutter
Client-Side Simplicity
Callbacks and helpers keep state handling lightweight in Dart
Unified Native SDKs
The Flutter bridge delegates to the same production Swift and Kotlin SDKs that power our mobile apps
Architecture
The Dart layer forwards every security-critical operation to the same HawcxSDK code that runs inside our production iOS and Android apps.
Flutter is on the v5 generation
The Flutter SDK bridges to the v5-generation native HawcxSDK (as the diagram shows). The newer V6 adaptive flow — backend-selected primary/MFA and trusted-device steps — that iOS, Android, and React Native offer is not yet available for Flutter.
Quick Start
Add the package to your pubspec.yaml:
dependencies:
hawcx_flutter_sdk: ^1.0.5Then fetch packages:
flutter pub getRequirements: Flutter 3.19+, iOS 17+, Android 8+ (minSdk 26).
The plugin depends on the Hawcx Android SDK published from our public Maven repository. Add it to your Gradle repositories:
dependencyResolutionManagement {
repositories {
maven {
url = uri("https://raw.githubusercontent.com/hawcx/hawcx_android_sdk/main/maven")
metadataSources {
mavenPom()
artifact()
}
}
google()
mavenCentral()
}
}If your project still uses android/build.gradle repositories, add the same maven { url ... } block there instead.
The plugin bundles the Hawcx iOS xcframework. After adding the package, run:
cd ios && pod installNo additional CocoaPods configuration is required.
import 'package:hawcx_flutter_sdk/hawcx_flutter_sdk.dart';
final client = HawcxClient();
Future<void> bootstrapHawcx() async {
await client.initialize(HawcxConfig(
projectApiKey: 'YOUR_CONFIG_ID',
baseUrl: '<Base URL from Admin Console>',
));
}baseUrl is unique to your environment. Find it in the Hawcx Admin Console under Project Settings, alongside your Config ID.
Do not pass OAuth client credentials to the mobile app. Your backend should redeem authorization codes using the Hawcx OAuth credentials we issued for your project.
Core Features
The Flutter SDK exposes the same authentication flow as our native apps: a single method (authenticate) handles login vs registration, and OTP collection happens only when the backend requires additional verification.
Troubleshooting
Next steps
Your app can now authenticate. The flow returns an auth code that your backend still has to exchange, so a Flutter integration is not complete until that half is wired up.
Exchange the code on your backend (Node.js)
Trade the auth code for verified user claims.
Exchange the code on your backend (Python)
Trade the auth code for verified user claims.
Exchange the code on your backend (Java)
Trade the auth code for verified user claims.
ID tokens and claims
What Hawcx puts in the token, and how to verify it.
Troubleshooting
Common failures during a first integration and how to read them.
Get support
Slack and email, and what to have ready before you ask.
Last updated on