{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"redocly_category":"SDK Reference","type":"markdown"},"seo":{"title":"Functions","description":"Everything about Mosaic Journeys, SDKs, and APIs","siteUrl":"https://developer.transmitsecurity.com"},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"functions","__idx":0},"children":["Functions"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Methods are exposed on the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["cordova.tsido"]}," object, which is available after the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["deviceready"]}," event."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["initializeSDK"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["initialize"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["startJourney"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["startMobileApproveJourney"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["submitClientResponse"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["generateDebugPin"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["setLoggingEnabled"]},", and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["setPushToken"]}," return a Promise that resolves with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["true"]}," when the native call is accepted (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["generateDebugPin"]}," resolves with a PIN string). Journey steps, instructions, and journey errors arrive on the listener from ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#addjourneyresponselistener"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["addJourneyResponseListener"]}]},", not on those Promises."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Promise rejections are ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["{ code, message }"]},". See ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#promise-rejection-codes"},"children":["Promise rejection codes"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"initializesdk","__idx":1},"children":["initializeSDK"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["▸ ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["initializeSDK"]},"(",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["configurationFile?"]},"): ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Promise<boolean>"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Initializes the plugin from ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["TransmitSecurity.plist"]}," on iOS or from ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["strings.xml"]}," on Android. ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["configurationFile"]}," is the iOS plist basename and defaults to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["TransmitSecurity"]},". Android ignores it."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"parameters","__idx":2},"children":["Parameters"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"align":"left","data-label":"Name"},"children":["Name"]},{"$$mdtype":"Tag","name":"th","attributes":{"align":"left","data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"align":"left","data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["configurationFile?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["iOS plist basename. Defaults to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["TransmitSecurity"]},"."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"returns","__idx":3},"children":["Returns"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Promise<boolean>"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Resolves with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["true"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"example","__idx":4},"children":["Example"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"javascript","header":{"controls":{"copy":{}}},"source":"await cordova.tsido.initializeSDK('TransmitSecurity');\n","lang":"javascript"},"children":[]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"initialize","__idx":5},"children":["initialize"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["▸ ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["initialize"]},"(",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["clientId"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["options?"]},"): ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Promise<boolean>"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Initializes the plugin with an explicit client ID."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"parameters-1","__idx":6},"children":["Parameters"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"align":"left","data-label":"Name"},"children":["Name"]},{"$$mdtype":"Tag","name":"th","attributes":{"align":"left","data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"align":"left","data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["clientId"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Client ID from the app in the Admin Portal"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["options?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/sdk-ref/cordova-ts-identity-orchestration/interfaces/initializeoptions"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["InitializeOptions"]}]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Server path and optional SDK settings"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"returns-1","__idx":7},"children":["Returns"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Promise<boolean>"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Resolves with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["true"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"example-1","__idx":8},"children":["Example"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"javascript","header":{"controls":{"copy":{}}},"source":"await cordova.tsido.initialize('YOUR_CLIENT_ID', {\n  serverPath: 'https://api.transmitsecurity.io',\n  collectRiskData: false, // Set to true when the journey uses Risk Level Analysis\n});\n","lang":"javascript"},"children":[]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"setloggingenabled","__idx":9},"children":["setLoggingEnabled"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["▸ ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["setLoggingEnabled"]},"(",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["enabled"]},"): ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Promise<boolean>"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Turns native logging and the plugin's JavaScript logging on or off. Logging is off by default. JavaScript lines are prefixed ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["TSIdo:"]}," and use a single-string ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["console.log"]},". On iOS, WKWebView bridges ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["console.log"]}," to the Xcode console reliably when it has one string argument."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"parameters-2","__idx":10},"children":["Parameters"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"align":"left","data-label":"Name"},"children":["Name"]},{"$$mdtype":"Tag","name":"th","attributes":{"align":"left","data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"align":"left","data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["enabled"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["boolean"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["true"]}," sets the native log level to debug and enables JavaScript logging"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"returns-2","__idx":11},"children":["Returns"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Promise<boolean>"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Resolves with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["true"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"example-2","__idx":12},"children":["Example"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"javascript","header":{"controls":{"copy":{}}},"source":"await cordova.tsido.setLoggingEnabled(true);\n","lang":"javascript"},"children":[]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"addjourneyresponselistener","__idx":13},"children":["addJourneyResponseListener"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["▸ ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["addJourneyResponseListener"]},"(",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["listener"]},"): ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["{ remove: () => boolean }"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Registers a listener for journey events. Call this before ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#startjourney"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["startJourney"]}]},". This method is synchronous."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The plugin buffers events until the first listener attaches, up to 50 events, so a response produced during startup is delivered. Register the listener yourself. Do not rely on the buffer."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The listener receives a ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/sdk-ref/cordova-ts-identity-orchestration/interfaces/journeyevent"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["JourneyEvent"]}]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"parameters-3","__idx":14},"children":["Parameters"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"align":"left","data-label":"Name"},"children":["Name"]},{"$$mdtype":"Tag","name":"th","attributes":{"align":"left","data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"align":"left","data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["listener"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["(event: JourneyEvent) => void"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Called for each journey response, instruction, or error"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"returns-3","__idx":15},"children":["Returns"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["{ remove: () => boolean }"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["remove()"]}," unsubscribes this listener and returns whether it was still registered."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"example-3","__idx":16},"children":["Example"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"javascript","header":{"controls":{"copy":{}}},"source":"function onJourneyEvent(event) {\n  switch (event.type) {\n    case 'response':\n      return onStep(event.response);\n    case 'instruction':\n      return console.log(event.instruction.type);\n    case 'error':\n      return console.error(event.error.code, event.error.message);\n  }\n}\n\nconst subscription = cordova.tsido.addJourneyResponseListener(onJourneyEvent);\n","lang":"javascript"},"children":[]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"removejourneyresponselistener","__idx":17},"children":["removeJourneyResponseListener"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["▸ ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["removeJourneyResponseListener"]},"(",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["listener"]},"): ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["boolean"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Removes a listener previously passed to ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#addjourneyresponselistener"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["addJourneyResponseListener"]}]},". This method is synchronous."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"parameters-4","__idx":18},"children":["Parameters"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"align":"left","data-label":"Name"},"children":["Name"]},{"$$mdtype":"Tag","name":"th","attributes":{"align":"left","data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"align":"left","data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["listener"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["function"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["The same function reference that was registered"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"returns-4","__idx":19},"children":["Returns"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["boolean"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["true"]}," when the listener was removed."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"example-4","__idx":20},"children":["Example"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"javascript","header":{"controls":{"copy":{}}},"source":"cordova.tsido.removeJourneyResponseListener(onJourneyEvent);\n","lang":"javascript"},"children":[]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"removealljourneyresponselisteners","__idx":21},"children":["removeAllJourneyResponseListeners"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["▸ ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["removeAllJourneyResponseListeners"]},"(): ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["void"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Removes every journey response listener. This method is synchronous."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"example-5","__idx":22},"children":["Example"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"javascript","header":{"controls":{"copy":{}}},"source":"cordova.tsido.removeAllJourneyResponseListeners();\n","lang":"javascript"},"children":[]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"startjourney","__idx":23},"children":["startJourney"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["▸ ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["startJourney"]},"(",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["journeyId"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["options?"]},"): ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Promise<boolean>"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Starts a journey. A resolved Promise means the request was accepted. The first step arrives on the listener."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"parameters-5","__idx":24},"children":["Parameters"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"align":"left","data-label":"Name"},"children":["Name"]},{"$$mdtype":"Tag","name":"th","attributes":{"align":"left","data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"align":"left","data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["journeyId"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Journey ID from the Admin Portal"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["options?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/sdk-ref/cordova-ts-identity-orchestration/interfaces/startjourneyoptions"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["StartJourneyOptions"]}]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Flow ID, additional parameters, encryption, and an optional Fraud Prevention session token"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"returns-5","__idx":25},"children":["Returns"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Promise<boolean>"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Resolves with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["true"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"example-6","__idx":26},"children":["Example"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"javascript","header":{"controls":{"copy":{}}},"source":"await cordova.tsido.startJourney('my_journey_id', {\n  flowId: 'optional-flow-id',\n  additionalParams: { tenant: 'acme' },\n  encryptionMode: false,\n});\n","lang":"javascript"},"children":[]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"startmobileapprovejourney","__idx":27},"children":["startMobileApproveJourney"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["▸ ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["startMobileApproveJourney"]},"(",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["payload"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["options?"]},"): ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Promise<boolean>"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Starts a mobile approve journey from a received push data payload. Pass the payload through as your push library delivered it. On Android the SDK takes a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Map<String, String>"]},", so non-string values are stringified. On iOS the payload is passed through as-is."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["payload"]}," has no request id, the journey fails with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["missingRequestIdInApprovalPayload"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This plugin does not register for push. Delivering the token and the notification is the app's job."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"parameters-6","__idx":28},"children":["Parameters"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"align":"left","data-label":"Name"},"children":["Name"]},{"$$mdtype":"Tag","name":"th","attributes":{"align":"left","data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"align":"left","data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["payload"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Object"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Push notification data payload"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["options?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/sdk-ref/cordova-ts-identity-orchestration/interfaces/startjourneyoptions"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["StartJourneyOptions"]}]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Same options as ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["startJourney"]}]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"returns-6","__idx":29},"children":["Returns"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Promise<boolean>"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Resolves with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["true"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"example-7","__idx":30},"children":["Example"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"javascript","header":{"controls":{"copy":{}}},"source":"await cordova.tsido.startMobileApproveJourney(pushData, { flowId: 'optional' });\n","lang":"javascript"},"children":[]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"submitclientresponse","__idx":31},"children":["submitClientResponse"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["▸ ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["submitClientResponse"]},"(",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["responseId"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data?"]},"): ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Promise<boolean>"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Answers the current journey step. ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["responseId"]}," is a built-in ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/sdk-ref/cordova-ts-identity-orchestration/enums/responseoptions"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["RESPONSE_OPTIONS"]}]}," value or a custom option id from ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["response.clientResponseOptions"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["errorData"]}," on an otherwise normal ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["response"]}," (for example a wrong one-time passcode) is a retryable step. Render the step again and surface the message. It is not a journey failure."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"parameters-7","__idx":32},"children":["Parameters"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"align":"left","data-label":"Name"},"children":["Name"]},{"$$mdtype":"Tag","name":"th","attributes":{"align":"left","data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"align":"left","data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["responseId"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["clientInput"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["cancel"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["fail"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["resend"]},", or a custom option id"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Object"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Payload matching that option's schema"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"returns-7","__idx":33},"children":["Returns"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Promise<boolean>"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Resolves with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["true"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"example-8","__idx":34},"children":["Example"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"javascript","header":{"controls":{"copy":{}}},"source":"await cordova.tsido.submitClientResponse('clientInput', { passcode: '123456' });\nawait cordova.tsido.submitClientResponse('cancel');\nawait cordova.tsido.submitClientResponse('fail');\nawait cordova.tsido.submitClientResponse('resend');\n\nconst option = response.clientResponseOptions.myCustomOption;\nawait cordova.tsido.submitClientResponse(option.id, { /* schema fields */ });\n","lang":"javascript"},"children":[]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"generatedebugpin","__idx":35},"children":["generateDebugPin"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["▸ ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["generateDebugPin"]},"(): ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Promise<string>"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Returns a debug PIN for a journey paused on a debug break."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"returns-8","__idx":36},"children":["Returns"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Promise<string>"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"example-9","__idx":37},"children":["Example"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"javascript","header":{"controls":{"copy":{}}},"source":"const pin = await cordova.tsido.generateDebugPin();\n","lang":"javascript"},"children":[]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"setpushtoken","__idx":38},"children":["setPushToken"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["▸ ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["setPushToken"]},"(",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["token"]},"): ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Promise<boolean>"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Registers the push token used for mobile approve. Use the APNs token on iOS and the FCM token on Android."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"parameters-8","__idx":39},"children":["Parameters"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"align":"left","data-label":"Name"},"children":["Name"]},{"$$mdtype":"Tag","name":"th","attributes":{"align":"left","data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"align":"left","data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["token"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["APNs token on iOS, FCM token on Android"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"returns-9","__idx":40},"children":["Returns"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Promise<boolean>"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Resolves with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["true"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"example-10","__idx":41},"children":["Example"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"javascript","header":{"controls":{"copy":{}}},"source":"await cordova.tsido.setPushToken(token);\n","lang":"javascript"},"children":[]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"promise-rejection-codes","__idx":42},"children":["Promise rejection codes"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["These ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["code"]}," values are on Promise rejections. They cover missing arguments and synchronous SDK failures. Network and server errors for a running journey arrive as ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["{ type: 'error' }"]}," on the listener. See ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/sdk-ref/cordova-ts-identity-orchestration/interfaces/journeyevent"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["JourneyEvent"]}]},"."]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"align":"left","data-label":"Code"},"children":["Code"]},{"$$mdtype":"Tag","name":"th","attributes":{"align":"left","data-label":"Cause"},"children":["Cause"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["INVALID_ARGS"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["A required argument was missing or empty"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK_INIT_ERROR"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["initializeSDK"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["initialize"]}," failed"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["START_JOURNEY_ERROR"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["The SDK rejected ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["startJourney"]}," synchronously"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["START_MOBILE_APPROVE_ERROR"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["The SDK rejected ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["startMobileApproveJourney"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SUBMIT_RESPONSE_ERROR"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["The SDK rejected ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["submitClientResponse"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GENERATE_DEBUG_PIN_ERROR"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["generateDebugPin"]}," failed"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SET_PUSH_TOKEN_ERROR"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["setPushToken"]}," failed"]}]}]}]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"javascript","header":{"controls":{"copy":{}}},"source":"try {\n  await cordova.tsido.startJourney(journeyId);\n} catch (e) {\n  console.error(e.code, e.message);\n}\n","lang":"javascript"},"children":[]},{"$$mdtype":"Tag","name":"style","attributes":{},"children":["\ntable th:first-of-type {\n    width: 30%;\n}\ntable th:nth-of-type(2) {\n    width: 30%;\n}\ntable th:nth-of-type(3) {\n    width: 40%;\n}\n"]}]},"headings":[{"value":"Functions","id":"functions","depth":1},{"value":"initializeSDK","id":"initializesdk","depth":2},{"value":"Parameters","id":"parameters","depth":3},{"value":"Returns","id":"returns","depth":3},{"value":"Example","id":"example","depth":3},{"value":"initialize","id":"initialize","depth":2},{"value":"Parameters","id":"parameters-1","depth":3},{"value":"Returns","id":"returns-1","depth":3},{"value":"Example","id":"example-1","depth":3},{"value":"setLoggingEnabled","id":"setloggingenabled","depth":2},{"value":"Parameters","id":"parameters-2","depth":3},{"value":"Returns","id":"returns-2","depth":3},{"value":"Example","id":"example-2","depth":3},{"value":"addJourneyResponseListener","id":"addjourneyresponselistener","depth":2},{"value":"Parameters","id":"parameters-3","depth":3},{"value":"Returns","id":"returns-3","depth":3},{"value":"Example","id":"example-3","depth":3},{"value":"removeJourneyResponseListener","id":"removejourneyresponselistener","depth":2},{"value":"Parameters","id":"parameters-4","depth":3},{"value":"Returns","id":"returns-4","depth":3},{"value":"Example","id":"example-4","depth":3},{"value":"removeAllJourneyResponseListeners","id":"removealljourneyresponselisteners","depth":2},{"value":"Example","id":"example-5","depth":3},{"value":"startJourney","id":"startjourney","depth":2},{"value":"Parameters","id":"parameters-5","depth":3},{"value":"Returns","id":"returns-5","depth":3},{"value":"Example","id":"example-6","depth":3},{"value":"startMobileApproveJourney","id":"startmobileapprovejourney","depth":2},{"value":"Parameters","id":"parameters-6","depth":3},{"value":"Returns","id":"returns-6","depth":3},{"value":"Example","id":"example-7","depth":3},{"value":"submitClientResponse","id":"submitclientresponse","depth":2},{"value":"Parameters","id":"parameters-7","depth":3},{"value":"Returns","id":"returns-7","depth":3},{"value":"Example","id":"example-8","depth":3},{"value":"generateDebugPin","id":"generatedebugpin","depth":2},{"value":"Returns","id":"returns-8","depth":3},{"value":"Example","id":"example-9","depth":3},{"value":"setPushToken","id":"setpushtoken","depth":2},{"value":"Parameters","id":"parameters-8","depth":3},{"value":"Returns","id":"returns-9","depth":3},{"value":"Example","id":"example-10","depth":3},{"value":"Promise rejection codes","id":"promise-rejection-codes","depth":2}],"frontmatter":{"seo":{"title":"Functions"}},"lastModified":"2026-11-02T11:00:30.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/sdk-ref/cordova-ts-identity-orchestration/functions","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}