# Installation

Add MoonPay Embedded Wallets authentication and embedded wallets to a Flutter app for iOS and Android with the `moonx_flutter` package.

The Flutter SDK is **headless**, like the [React Native SDK](/get-started/frontend-sdks/react-native/installation): it provides a client with session state, native passkey ceremonies, and wallet operations, while your app owns every screen. The only UI the SDK shows is a sheet for key export and for an hCaptcha challenge that needs user interaction.

## Supported versions

| | Minimum | Tested |
|---|---|---|
| Flutter / Dart | 3.35.0 / 3.9.0 | 3.35.0 and the latest stable release |
| iOS | 16.0 | 16.0, 16.4, 17.5, 18.5, 18.6, 26.5 |
| Android OS | API 27 (Android 8.1) | API 27, 35, 36, 37 |
| Android System WebView | Chromium 111 | 124 and later |
| Android `compileSdk` | 36 | 36 |
| Android Gradle Plugin | 8.x or 9.x | 8.13 and 9.1 |
| Native passkeys on Android | API 28 (Android 9) | |

On iOS, every dependency supports Swift Package Manager, so apps that enable Flutter's Swift Package Manager integration build without warnings.

<Info>
  On Android, the WebView version does not follow the OS version. Users update Android System WebView (or Chrome) through the Play Store. If the installed WebView is older than Chromium 111, the SDK reports `unsupported_webview` instead of loading. See [Startup failures](/get-started/frontend-sdks/flutter/setup#startup-failures).
</Info>

On Android 8.1 (API 27), native passkeys are not available. Users on that version can sign in and use wallets protected by [identity-backed encryption](/wallets/identity-backed-encryption).

## Install the SDK

```bash
flutter pub add moonx_flutter
```

Or add it to `pubspec.yaml` and run `flutter pub get`:

```yaml [pubspec.yaml]
dependencies:
  moonx_flutter: ^0.1.0-beta.6
```

The SDK is in beta, so only prerelease versions are published. `flutter pub add` selects the latest one. A caret constraint on a beta version also accepts later betas and the stable `0.1.0` release.

The package brings its own dependencies (WebView, secure storage, passkeys, and OAuth browser), so there are no peer packages to install.

## iOS setup

Set the deployment target to 16.0 or later in `ios/Podfile` (`platform :ios, '16.0'`) and in the Xcode project.

For passkeys, add an Associated Domains entitlement for your Relying Party ID (`webcredentials:<rp_id>`) and host the `apple-app-site-association` file on that domain.

Google and Apple login use `ASWebAuthenticationSession` and need no `Info.plist` entry.

## Android setup

Set `minSdk` to 27 or later and `compileSdk` to 36 or later in `android/app/build.gradle` (or `build.gradle.kts`).

For passkeys, serve `/.well-known/assetlinks.json` on your Relying Party ID with your app's signing certificate, and register the certificate fingerprints in the Embedded Wallets Dashboard.

For Google and Apple login, declare the OAuth callback activity inside `<application>` in `AndroidManifest.xml`, using the scheme of your OAuth redirect URI:

```xml [android/app/src/main/AndroidManifest.xml]
<activity
    android:name="com.linusu.flutter_web_auth_2.CallbackActivity"
    android:exported="true">
    <intent-filter android:label="flutter_web_auth_2">
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
        <data android:scheme="myapp" />
    </intent-filter>
</activity>
```

<Warning>
  Passkeys need association files on your domain and signing fingerprints registered in the Embedded Wallets Dashboard. The [Mobile Passkeys guide](/wallets/mobile-passkeys) covers the files, the fingerprints, and how to verify them. Its iOS and Android sections apply to Flutter apps too.
</Warning>

## Verify installation

```dart
import 'package:moonx_flutter/moonx_flutter.dart';
```

If the import resolves, the SDK is installed. Next, [set up the client](/get-started/frontend-sdks/flutter/setup).

## Next steps

* [Create the client and host](/get-started/frontend-sdks/flutter/setup)
* [Build your first login and wallet flow](/get-started/frontend-sdks/flutter/quick-start)
* [Complete the passkey platform setup](/wallets/mobile-passkeys)
