Skip to content

initializeSDK

initializeSDK(): void

Creates a new Orchestration SDK instance with your client context. On iOS, credentials are configured from the TransmitSecurity.plist file. On Android, initialization is performed in the native MainApplication class.

Example

import RNTSIdentityOrchestration from 'react-native-ts-identity-orchestration';

if (Platform.OS === 'ios') {
  RNTSIdentityOrchestration.initializeSDK();
}
Note

On Android, initialization must be done natively. Add TsIdentityOrchestrationModule.initializeAndroidSDK(this) to your MainApplication.kt onCreate() method.


setResponseHandler

setResponseHandler(handler): void

Sets a response handler for journey responses and errors. Must be called before startJourney() or startMobileApproveJourney().

Parameters

NameTypeDescription
handlerObjectObject containing success and error callbacks
handler.success(results: TSIDOModule.ServiceResponse) => voidCalled when a journey step response is received
handler.error(error: TSIDOModule.JourneyErrorType) => voidCalled when a journey error occurs

Example

import RNTSIdentityOrchestration, { TSIDOModule } from 'react-native-ts-identity-orchestration';

RNTSIdentityOrchestration.setResponseHandler({
    success: (results: TSIDOModule.ServiceResponse) => {
        // Handle journey step
    },
    error: (error: TSIDOModule.JourneyErrorType) => {
        // Handle error
    }
});

startJourney

startJourney(journeyId, options?): void

Starts a journey with the given identifier. The response is delivered asynchronously through the handler set via setResponseHandler().

Parameters

NameTypeDescription
journeyIdstringJourney identifier as configured in the Admin Portal
options?TSIDOModule.StartJourneyOptions | nullOptional journey start parameters

The StartJourneyOptions object supports:

PropertyTypeDescription
additionalParams{ [key: string]: any }Key-value parameters passed to the journey, accessible via @policy.request().params.<key>
flowIdstringOptional flow identifier for tracking
encryptedbooleanEnables encryption mode (true = full, false = none)

Example

import RNTSIdentityOrchestration, { TSIDOModule } from 'react-native-ts-identity-orchestration';

const options: TSIDOModule.StartJourneyOptions = {
    flowId: 'login-flow',
    additionalParams: { userEmail: 'name@example.com' }
};

RNTSIdentityOrchestration.startJourney('my_journey_id', options);

startMobileApproveJourney

startMobileApproveJourney(payload, options?): void

Starts a mobile approve journey to handle approval flows (such as transaction signing or push notifications). The response is delivered asynchronously through the handler set via setResponseHandler().

Parameters

NameTypeDescription
payload{ [key: string]: string }Key-value object containing approval data
options?TSIDOModule.StartJourneyOptions | nullOptional journey start parameters

Example

import RNTSIdentityOrchestration, { TSIDOModule } from 'react-native-ts-identity-orchestration';

const payload = { transactionId: '12345', amount: '$100' };

RNTSIdentityOrchestration.startMobileApproveJourney(payload, null);

submitClientResponse

submitClientResponse(clientResponseOptionId, data?): void

Submits a client response for the current journey step. This advances the journey to the next step based on the selected response option and any collected data.

Parameters

NameTypeDescription
clientResponseOptionIdstring | TSIDOModule.ClientResponseOptionTypeThe response option ID, either a standard type or a custom branch ID
data?{ [key: string]: any } | nullClient response data object, required for steps that collect input

Standard response option types (TSIDOModule.ClientResponseOptionType):

ValueDescription
clientInputTypical reply to a step with a main or single output path
cancelSelects the cancel branch
failSelects the failure branch

Example

import RNTSIdentityOrchestration, { TSIDOModule } from 'react-native-ts-identity-orchestration';

// Simple response (e.g., information step)
RNTSIdentityOrchestration.submitClientResponse(TSIDOModule.ClientResponseOptionType.clientInput);

// Response with data (e.g., form input)
RNTSIdentityOrchestration.submitClientResponse(
    TSIDOModule.ClientResponseOptionType.clientInput,
    { externalUserId: userId, userPassword: password }
);

// Custom branch response
RNTSIdentityOrchestration.submitClientResponse('passkey', {
    webauthn_encoded_result: encodedResult
});

ServiceResponse

See ServiceResponse for the full interface reference.


JourneyActionType

See JourneyActionType for the full enum reference.


ClientResponseOptionType

See ClientResponseOptionType for the full enum reference.