Skip to content

JourneyEvent

Payload delivered to the listener registered with addJourneyResponseListener(). type is response, instruction, or error.

Response

A journey step, including terminal success and rejection.

{
  type: 'response',
  journeyStepId: 'emailOTPAuthentication',
  response: {
    journeyStepId: 'emailOTPAuthentication',
    journeyStepIdRaw: 'transmit_platform_email_otp_authentication',
    data: {},
    clientResponseOptions: {},
    token: '',
    code: '',
    errorData: { code: '', message: '' },
  },
}

journeyStepId

• journeyStepId: string

Copy of response.journeyStepId, normalized across iOS and Android. See STEPS. A custom or unrecognized action is passed through as its raw identifier.


response.data

• Optional data: Object

Free-form step payload.


response.clientResponseOptions

• Optional clientResponseOptions: Object

Options the step accepts. Each option can include id, label, type, and schema. type is clientInput, cancel, fail, resend, or custom. Submit the chosen option with submitClientResponse().

{
  clientInput: {
    id: 'clientInput',
    label: 'Verify',
    type: 'clientInput',
    schema: [{ name: 'passcode', type: 'string', optional: false }],
  },
  resend: { id: 'resend', label: 'Resend code', type: 'resend' },
  cancel: { id: 'cancel', label: 'Cancel', type: 'cancel' },
}

The plugin accepts the camelCase tokens above and the snake_case ids the server may put on option.id (client_input, action_failure). Pass either form to submitClientResponse.


response.token

• Optional token: string

Present on success.


response.code

• Optional code: string

Token-exchange code. Present on success.


response.errorData

• Optional errorData: { code: string, message: string }

Present on a retryable step error, such as a wrong one-time passcode. The journey is still on that step.


response.journeyStepIdRaw

• journeyStepIdRaw: string

Step id as the native SDK reported it, before normalization.

Instruction

A side-channel instruction. Current types are PIN registration commit and PIN deletion commit. See INSTRUCTIONS.

{
  type: 'instruction',
  instruction: { type: 'pinCodeRegistrationCommit', typeRaw: '', stepId: '', data: {} },
}

instruction.type

• type: string

Normalized instruction type.


instruction.typeRaw

• typeRaw: string

Instruction type as the native SDK reported it.


instruction.stepId

• stepId: string

Step that emitted the instruction.


instruction.data

• data: Object

Instruction payload.

Error

A journey failure. Argument and other synchronous failures reject the method Promise instead. See Promise rejection codes.

{
  type: 'error',
  error: { code: 'networkError', message: '' },
}

error.code is the same string on iOS and Android:

notInitialized, noActiveJourney, networkError, clientResponseNotValid, serverError, invalidInitializationOptions, invalidStateString, internalError, deviceRegistrationError, deviceValidationError, invalidCredentials, expiredOTPPasscode, expiredValidationPasscode, maxResendReached, missingRequestIdInApprovalPayload

Android also reports Identity Verification failures on this channel: idvCameraPermissionRequired, idvSdkDisabled, idvSessionNotValid, idvInitializationError, idvNotInitialized, idvCanceled, idvInternalError, idvNotAvailable. The iOS SDK 1.2.5 has no equivalent cases, so the same failure arrives there as internalError. Treat an unrecognized code as internalError.