# Overview

The `cordova-plugin-identity-orchestration` plugin runs Mosaic [Journeys](/guides/orchestration/concepts/journeys_overview) from a Cordova app on iOS and Android. A journey is a server-driven flow: you start it by id, the SDK reports each step the client needs to handle, and you answer with `submitClientResponse` until the journey completes or is rejected.

The plugin exposes `cordova.tsido`. Journey state is pushed to a listener. It is not the return value of `startJourney()`.

For native SDK behavior, see the [iOS quickstart](/guides/orchestration/getting-started/quick_start_ios) and the [Android quickstart](/guides/orchestration/getting-started/quick_start_android).

## Capabilities

- Start a journey and receive each step on a listener
- Submit a client response, including cancel, fail, and resend
- Start a mobile approve journey from a push payload
- Register an APNs or FCM token for mobile approve
- Generate a debug PIN for a journey paused on a debug break


## Requirements

- `cordova-ios` 8.0.0 or higher
- `cordova-android` 14.0.1 or higher
- iOS 13.0 or higher, Xcode 16 or higher (Swift Package Manager must reach GitHub)
- Android `minSdk` 24 (the SDK floor is API 21), `compileSdk` 35
- `android.useAndroidX=true` (cordova-android 14 sets this by default)


## Installation

```bash
cordova plugin add https://github.com/TransmitSecurity/cordova_ts_identity_orchestration_plugin.git#v1.0.0
cordova platform add ios android
cordova prepare ios android
```

## Platform configuration

iOS
Set the deployment target in `config.xml`:

```xml
<platform name="ios">
    <preference name="deployment-target" value="13.0" />
</platform>
```

Xcode resolves `IdentityOrchestration` and `TSCoreSDK` through Swift Package Manager on the first build. If it does not, use **File** → **Packages** → **Resolve Package Versions**.

This plugin does not use CocoaPods. `cordova prepare` removes the unused CocoaPods files that cordova-ios generates, so the iOS project stays on Swift Package Manager.

When a journey uses the camera or Face ID, add the usage strings yourself. The plugin does not request permissions it cannot know you need:

```xml
<platform name="ios">
    <config-file target="*-Info.plist" parent="NSCameraUsageDescription">
        <string>Used to capture identity documents.</string>
    </config-file>
    <config-file target="*-Info.plist" parent="NSFaceIDUsageDescription">
        <string>Used to authenticate you.</string>
    </config-file>
</platform>
```

Android
Set `minSdk` in `config.xml`:

```xml
<platform name="android">
    <preference name="android-minSdkVersion" value="24" />
</platform>
```

The plugin adds the `INTERNET` and `ACCESS_NETWORK_STATE` permissions, the Transmit Security Maven repository, and the SDK dependency.

Two `after_prepare` hooks run on `cordova prepare`:

- Kotlin compilation is turned back on. cordova-android sets `IS_GRADLE_PLUGIN_KOTLIN_ENABLED` to `false` on every prepare, which makes Gradle skip the plugin's Kotlin file. A missing plugin at runtime is the symptom. Android Studio can still index the Kotlin when the flag is off.
- The Gradle wrapper is pinned to the cordova-android version. Android Studio may bump the wrapper to 9.x, which AGP 8.7.x rejects with `Cannot select root node 'debugRuntimeClasspathCopy'`.


## Credentials

`initializeSDK()` reads credentials from a native config file. `initialize(clientId, options)` takes them in JavaScript. Use one of the two.

iOS
Ship `TransmitSecurity.plist` as a resource:

```xml
<platform name="ios">
    <resource-file src="resources/ios/TransmitSecurity.plist" target="TransmitSecurity.plist" />
</platform>
```

```xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>credentials</key>
    <dict>
        <key>baseUrl</key>
        <string>https://api.transmitsecurity.io/</string>
        <key>clientId</key>
        <string>YOUR_CLIENT_ID</string>
        <key>applicationId</key>
        <string>default_application</string>
    </dict>
</dict>
</plist>
```

The `configurationFile` argument is the iOS plist basename. Android ignores it and reads string resources.

Android
```xml
<resources>
    <string name="transmit_security_client_id">YOUR_CLIENT_ID</string>
    <string name="transmit_security_base_url">https://api.transmitsecurity.io/</string>
    <string name="transmit_security_app_id">default_application</string>
</resources>
```

Use the API base URL for your region:

| 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-custom-domain>/` (see [Custom domains](/guides/deployment/custom_domains)) |


## Initialization

Register a journey listener before you start a journey. The plugin buffers events until the first listener attaches, on the native side and in JavaScript, up to 50 events. Treat that buffer as a safety net for the startup race.

```javascript
document.addEventListener('deviceready', function () {
  cordova.tsido.addJourneyResponseListener(onJourneyEvent);

  cordova.tsido.setLoggingEnabled(true)
    .then(function () { return cordova.tsido.initializeSDK('TransmitSecurity'); })
    .catch(function (e) { console.error('init failed', e); });
}, false);
```

`initializeSDK()` with no argument uses the default plist name `TransmitSecurity`. Or pass an explicit client ID:

```javascript
await cordova.tsido.initialize('YOUR_CLIENT_ID', {
  serverPath: 'https://api.transmitsecurity.io',
});
```

See [`InitializeOptions`](/sdk-ref/cordova-ts-identity-orchestration/interfaces/initializeoptions) for the full options object.

## Next steps

- [Orchestration quickstart: Cordova](/guides/orchestration/getting-started/quick_start_cordova)
- [Orchestration functions](/sdk-ref/cordova-ts-identity-orchestration/functions)
- [Journeys overview](/guides/orchestration/concepts/journeys_overview)
- [Authentication SDK](/sdk-ref/cordova-ts-authentication/authentication_overview) for passkey, biometric, and TOTP steps that this plugin cannot complete on its own
- [Fraud Prevention SDK](/sdk-ref/cordova-ts-accountprotection/drs_overview) for the `drsTriggerAction` step