# Overview

The `flutter_ts_identity_orchestration` is a Flutter plugin for Mosaic Orchestration. It enables secure identity verification and authentication flows in your Flutter app using Mosaic. It allows your application to start journeys, handle journey steps, and submit client responses through a stream-based event model.

Note
For platform-specific implementation details and advanced configuration, refer to the native SDK documentation:

- [iOS documentation](https://developer.transmitsecurity.com/guides/webauthn/quick_start_sdk_ios/)
- [Android documentation](https://developer.transmitsecurity.com/guides/webauthn/quick_start_sdk_android/)


## Capabilities

- Start and manage journeys from the client side
- Handle journey steps and submit client responses
- Stream-based real-time event handling via `journeyResponseStream`
- Support for mobile approve flows
- Push token management
- Debug PIN generation for development


## Requirements

- Flutter 3.3.0+, Dart 3.8.1+
- iOS 13.0+, Xcode 12+
- Android API 21+ (Android 5.0), compileSdkVersion 35+


## Installation

Add the dependency to your `pubspec.yaml`:

```yaml
dependencies:
  flutter_ts_identity_orchestration:
    git:
      url: https://github.com/TransmitSecurity/flutter_ts_identity_orchestration.git
      ref: 0.0.5
```

Install dependencies:

```bash
flutter pub get
```

## Platform setup

iOS
Add permissions to `ios/Runner/Info.plist` (if using camera and FaceID):

```xml
<key>NSCameraUsageDescription</key>
<string>This app needs camera access for identity verification</string>
<key>NSFaceIDUsageDescription</key>
<string>This app uses Face ID for authentication</string>
```

Set the minimum iOS version in `ios/Podfile`:

```ruby
platform :ios, '13.0'
```

Android
Add permissions to `android/app/src/main/AndroidManifest.xml`:

```xml
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CAMERA" />
```

Add the Maven repository to `android/build.gradle`:

```gradle
allprojects {
    repositories {
        google()
        mavenCentral()
        maven {
            url "https://transmit.jfrog.io/artifactory/transmit-security-gradle-release-local/"
        }
    }
}
```

Update `android/app/build.gradle`:

```gradle
android {
    compileSdkVersion 35

    defaultConfig {
        minSdkVersion 21
        targetSdkVersion 34
    }
}
```

Make sure your `MainActivity` inherits from `FlutterFragmentActivity`:

```kotlin
import io.flutter.embedding.android.FlutterFragmentActivity

class MainActivity: FlutterFragmentActivity() {
}
```

This is required for proper plugin functionality and native SDK integration.

## Modular Identity Verification

The plugin does not include the Identity Verification native SDK. Add it only when a journey captures a document or selfie. Journeys that never do this do not need it, and leaving it out is safe.

If you add it, use version 1.3.5 or higher on Android and iOS. On iOS, an older Identity Verification SDK crashes the app at launch, including for users who never reach that step.

There is no plugin method to call. When the journey reaches document or selfie capture, the native SDK presents its own UI. Camera permission is required before capture can start.

Android
Add the SDK to `android/app/build.gradle`. The Transmit Maven repository from the platform setup above is required.

```gradle
dependencies {
    implementation "com.ts.sdk:identityverification:1.3.5"
}
```

iOS
Add the Swift package `https://github.com/TransmitSecurity/identityVerification-ios-sdk` to the Runner target. Set the dependency rule to exact version 1.3.5, or up to next major from 1.3.5. The iOS SDK is not published to CocoaPods.

## Initialization

You can initialize the SDK either with a configuration file or with explicit parameters.

Configuration file
```dart
import 'package:flutter_ts_identity_orchestration/flutter_ts_identity_orchestration.dart';

final orchestration = FlutterTsIdentityOrchestration();
await orchestration.initializeSDK(configurationFile: 'TransmitSecurity');
```

Parameters
```dart
import 'package:flutter_ts_identity_orchestration/flutter_ts_identity_orchestration.dart';

final orchestration = FlutterTsIdentityOrchestration();
await orchestration.initialize(
  clientId: 'CLIENT_ID',
  options: {
    'serverPath': 'https://api.transmitsecurity.io',
    'locale': 'en',
  },
);
```

## Regional base URLs

| Region | Base URL |
|  --- | --- |
| US | `https://api.transmitsecurity.io` |
| EU | `https://api.eu.transmitsecurity.io` |
| Canada | `https://api.ca.transmitsecurity.io` |
| Australia | `https://api.au.transmitsecurity.io` |
| Japan | `https://api.gasne1-ts01.transmitsecurity.io` |
| Sandbox | `https://api.sbx.transmitsecurity.io` |
| Custom domain | `https://<your-domain>.com` (see [Custom domains](/guides/deployment/custom_domains)). Also enables [app-specific signing keys](/guides/user/token_signing_keys#configure-app-specific-signing-keys) for journeys. |
| App subdomain | `https://<prefix>.app.transmitsecurity.io`, or its regional variant (see [Application domain](/guides/user/manage_apps#advanced-settings)). Also enables [app-specific signing keys](/guides/user/token_signing_keys#configure-app-specific-signing-keys) for journeys. |


## Next steps

Once initialized, implement orchestration flows using the available [functions](/sdk-ref/flutter-ts-identity-orchestration/functions).