▸ initializeSDK({configurationFile}): Future<void>
Initializes the SDK using a configuration file (iOS plist or Android auto-detected configuration).
| Name | Type | Description |
|---|---|---|
configurationFile | String? | Name of the configuration file (without extension on iOS) |
final orchestration = FlutterTsIdentityOrchestration();
await orchestration.initializeSDK(configurationFile: 'TransmitSecurity');▸ initialize({clientId, options}): Future<void>
Initializes the SDK with explicit parameters.
| Name | Type | Description |
|---|---|---|
clientId | String | Your Mosaic client ID |
options | Map<String, dynamic> | Configuration options (see below) |
Options:
| Key | Type | Description |
|---|---|---|
serverPath | String | Server URL (default: https://api.transmitsecurity.io) |
resource | String? | Custom resource path |
pollingTimeout | int? | Polling timeout in milliseconds |
locale | String? | Locale setting (default: 'en') |
await orchestration.initialize(
clientId: 'CLIENT_ID',
options: {
'serverPath': 'https://api.transmitsecurity.io',
'pollingTimeout': 30000,
'locale': 'en',
},
);▸ journeyResponseStream: Stream<Map<String, dynamic>>
Stream that delivers real-time journey events. This is the only way the SDK communicates journey responses to your app.
You must listen to this stream before starting any journey. Without an active listener, your app will not receive journey responses—steps, authentication results, and errors will be lost.
| Key | Type | Description |
|---|---|---|
success | bool | Whether the response represents a successful step |
response | Map? | Response data including journeyStepId |
error | String? | Error message if success is false |
type | String? | Response type (e.g., 'instructions') |
instructions | Map? | Additional instructions data when type is 'instructions' |
When calling submitClientResponse or startMobileApproveJourney, the native SDK may trigger additional instructions through the event stream. These are delivered as responses with type set to 'instructions' and should be handled separately from regular journey step responses.
orchestration.journeyResponseStream.listen(
(response) {
if (response['type'] == 'instructions') {
final instructions = response['instructions'];
// Handle native SDK instructions
return;
}
if (response['success'] == true) {
final stepId = response['response']?['journeyStepId'];
// Handle journey step
} else {
print('Error: ${response['error']}');
}
},
onError: (error) {
print('Stream error: $error');
},
);▸ startJourney({journeyId, options}): Future<void>
Starts an orchestration journey. Responses are delivered via journeyResponseStream.
| Name | Type | Description |
|---|---|---|
journeyId | String | The journey identifier configured in the Admin Portal |
options | Map<String, dynamic>? | Journey options (see below) |
Options:
| Key | Type | Description |
|---|---|---|
additionalParams | Map<String, String>? | Additional parameters to pass to the journey |
flowId | String? | Custom flow identifier |
encryptionMode | bool? | Enable encryption for the journey session |
await orchestration.startJourney(
journeyId: 'registration-flow',
options: {
'additionalParams': {'userType': 'premium'},
'encryptionMode': true,
},
);▸ submitClientResponse({responseId, data}): Future<bool>
Submits a client response during a journey flow. The next step is delivered via journeyResponseStream.
| Name | Type | Description |
|---|---|---|
responseId | String | Identifier for the response type |
data | Map<String, dynamic>? | Data to submit |
Common response IDs:
| ID | Description |
|---|---|
'clientInput' | Submit user input |
'cancel' | Cancel current step |
'fail' | Mark step as failed |
'resend' | Request resend (e.g., OTP) |
bool—true if the response was submitted successfully.
await orchestration.submitClientResponse(
responseId: 'clientInput',
data: {'email': 'user@example.com', 'password': 'secret'},
);The response ID for login form submissions may differ between platforms. On Android, use 'password'; on iOS, use 'Password'.
import 'dart:io' show Platform;
final responseId = Platform.isAndroid ? 'password' : 'Password';
await orchestration.submitClientResponse(
responseId: responseId,
data: {'username': username, 'password': password},
);▸ startMobileApproveJourney({payload, startJourneyOptions}): Future<void>
Starts a mobile approve journey. Responses are delivered via journeyResponseStream.
| Name | Type | Description |
|---|---|---|
payload | Map<String, dynamic> | Mobile approve payload (e.g., session data) |
startJourneyOptions | Map<String, dynamic> | Journey options (e.g., encryption settings) |
await orchestration.startMobileApproveJourney(
payload: {'sessionId': 'session-123'},
startJourneyOptions: {'encrypted': true},
);▸ generateDebugPin(): Future<String>
Generates a debug PIN for development and testing.
String—the generated debug PIN.
final pin = await orchestration.generateDebugPin();▸ setLoggingEnabled(enabled): Future<bool>
Enables or disables SDK logging.
| Name | Type | Description |
|---|---|---|
enabled | bool | true to enable logging, false to disable |
bool—true if the configuration was applied successfully.
await orchestration.setLoggingEnabled(true);▸ setPushToken(token): Future<void>
Sets the push notification token for the SDK to enable push-based flows.
| Name | Type | Description |
|---|---|---|
token | String | The push notification token from Firebase or APNs |
final token = await FirebaseMessaging.instance.getToken();
if (token != null) {
await orchestration.setPushToken(token);
}