{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["admonition"]},"redocly_category":"Journeys","product":"Identity Management","type":"markdown"},"seo":{"title":"Orchestration quickstart: Cordova","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":"orchestration-quickstart-cordova","__idx":0},"children":["Orchestration quickstart: Cordova"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This guide describes how to quickly integrate Journeys into your Cordova application."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Read the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/sdk-ref/cordova-ts-identity-orchestration/orchestration_overview"},"children":["Cordova Orchestration SDK reference"]}," for the full method list, including mobile approve and steps that need another Mosaic SDK."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"introduction","__idx":1},"children":["Introduction"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The Orchestration SDK enables client-side developers to build user experiences that interact with Client SDK journeys."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Each journey contains a business workflow, such as login or secure user onboarding. It consists of backend steps, such as data processing or invoking external systems, and client-facing steps, such as a login form or identity verification. The SDK allows the client application to present screens and prompt for user input, and then send this information back to the journey for further processing."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Whenever the client-side interaction requires additional Mosaic platform capabilities, such as passkeys or risk detection, the developer needs to activate the appropriate SDK module to perform the step and collect the required input. This allows separation of concerns between the journey workflow handling, and the specific capability used."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This guide will use the \"Hello World\" journey template and instruct you how to build a client side application that works with it."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"before-you-start","__idx":2},"children":["Before you start"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Before the SDK can start running journeys, make sure to:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Create a journey for this tutorial. In the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Admin Portal"]},", go to ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["B2C Identity"]}," or ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["B2B Identity"]}," (based on your setup) > ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Journeys"]},". From there click ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Templates"]},", and choose the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Level 0 tutorials / Hello world"]}," template. Create a journey from this template, set the name to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["hello-world-quickstart"]},", and save the journey ID."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Create a Mosaic application and obtain the auto-generated Client ID as described ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/guides/user/create_new_application"},"children":["here"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Allow Mosaic IPs and ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/guides/quick_start/enable_communication"},"children":["domains"]}," on your network. If you use a ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/guides/deployment/custom_domains"},"children":["custom domain"]},", configure your network accordingly."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"step-1-install-and-initialize-the-sdk","__idx":3},"children":["Step 1: Install and initialize the SDK"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Install the plugin, add your client credentials, and initialize it before the app starts a journey. The ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/sdk-ref/cordova-ts-identity-orchestration/orchestration_overview"},"children":["Cordova Orchestration SDK reference"]}," has the commands and configuration files. Do the following, in order:"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Confirm the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/sdk-ref/cordova-ts-identity-orchestration/orchestration_overview#requirements"},"children":["requirements"]},", then ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/sdk-ref/cordova-ts-identity-orchestration/orchestration_overview#installation"},"children":["install the plugin"]}," and apply the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/sdk-ref/cordova-ts-identity-orchestration/orchestration_overview#platform-configuration"},"children":["platform configuration"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Add the client ID and base URL to the native ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/sdk-ref/cordova-ts-identity-orchestration/orchestration_overview#credentials"},"children":["credential files"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["On ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["deviceready"]},", register a journey listener, then call ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["initializeSDK()"]},". See ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/sdk-ref/cordova-ts-identity-orchestration/orchestration_overview#initialization"},"children":["Initialization"]},". Journey steps arrive on that listener. They are not the return value of ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["startJourney()"]},". This guide defines the listener as ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onJourneyEvent"]}," in ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#1-select-handler"},"children":["Select handler"]},"."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"step-2-start-journey","__idx":4},"children":["Step 2: Start journey"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Starting a journey is usually a response to some user interaction, such as clicking a login or sign-up button. Call ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["startJourney()"]}," with the journey ID saved from the Hello World template. A resolved promise means the SDK accepted the request. The first step is delivered to the listener from ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#step-1-install-and-initialize-the-sdk"},"children":["Step 1"]},"."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"javascript","header":{"controls":{"copy":{}}},"source":"function startHelloWorld() {\n  cordova.tsido.startJourney('JOURNEY_ID') // Replace with the hello-world-quickstart journey ID\n    .catch(function (error) {\n      console.error(error.code, error.message);\n    });\n}\n","lang":"javascript"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"step-3-handle-service-response","__idx":5},"children":["Step 3: Handle service response"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["After starting the journey, the client app waits for a listener event whose ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["type"]}," is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["response"]},". The ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["response"]}," object contains what the client needs in order to determine what to do next. An event whose ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["type"]}," is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["error"]}," is a journey failure, with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["error.code"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["error.message"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To handle the service response, the client app needs to:"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#1-select-handler"},"children":["Select a handler based on the step"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#2-implement-the-hello-world-form-handler"},"children":["Implement the hello world form handler"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#3-implement-the-display-information-handler"},"children":["Implement the display information step handler"]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"1-select-handler","__idx":6},"children":["1. Select handler"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["When the listener receives a response, select a handler by switching on ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["response.journeyStepId"]},". In the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["hello-world-quickstart"]}," journey, handle these steps:"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["A ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/guides/orchestration/journeys/get_info_from_client"},"children":["Collect information"]}," step. This step expects the client to collect data and send it back. The step ID is the custom string ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["hello_world_form"]},", which is the value of ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["journeyStepId"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["A ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/guides/orchestration/journeys/display_information"},"children":["Display information"]}," step that presents text based on the data collected in the first step. Its ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["journeyStepId"]}," is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["cordova.tsido.STEPS.INFORMATION"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Handlers for ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Success"]}," and ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Rejection"]}," completion."]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"javascript","header":{"controls":{"copy":{}}},"source":"function onJourneyEvent(event) {\n  if (event.type === 'error') {\n    console.error(event.error.code, event.error.message);\n    return;\n  }\n  if (event.type === 'response') {\n    handleJourneyServiceResponse(event.response);\n  }\n}\n\nfunction handleJourneyServiceResponse(response) {\n  switch (response.journeyStepId) {\n    case cordova.tsido.STEPS.SUCCESS:\n      console.log('Journey completed successfully');\n      break;\n    case cordova.tsido.STEPS.REJECTION:\n      console.log('Journey rejected');\n      break;\n    case cordova.tsido.STEPS.INFORMATION:\n      handleDisplayInformation(response);\n      break;\n    case 'hello_world_form':\n      handleHelloWorldForm(response);\n      break;\n    default:\n      console.warn('Unknown journey step: ' + response.journeyStepId);\n      break;\n  }\n}\n","lang":"javascript"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Each case processes the data, displays whatever UI is needed, and calls ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["submitClientResponse()"]}," when the interaction is concluded."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"2-implement-the-hello-world-form-handler","__idx":7},"children":["2. Implement the Hello World form handler"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The following handler collects information from the user, as described in the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/guides/orchestration/journeys/get_info_from_client"},"children":["Collect information"]}," step. The Hello World form collects two strings and sends them back as ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["username"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["password"]},". This matches the schema on the journey's ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Collect information"]}," step, under ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Schema"]},":"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n  \"type\": \"object\",\n  \"properties\": {\n    \"username\": {\n      \"type\": \"string\"\n    },\n    \"password\": {\n      \"type\": \"string\",\n      \"format\": \"password\"\n    }\n  }\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Display a form that collects these fields. On submit, send them back to Mosaic. ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["cordova.tsido.RESPONSE_OPTIONS.CLIENT_INPUT"]}," is the standard response for this step:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"javascript","header":{"controls":{"copy":{}}},"source":"function handleHelloWorldForm(response) {\n  // Display a form and collect the required values.\n  var userData = {\n    username: collectedUserName,\n    password: collectedPassword\n  };\n  cordova.tsido.submitClientResponse(\n    cordova.tsido.RESPONSE_OPTIONS.CLIENT_INPUT,\n    userData\n  );\n}\n","lang":"javascript"},"children":[]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info","name":"Note"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The next step after ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["submitClientResponse()"]}," is delivered to the listener from ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#step-1-install-and-initialize-the-sdk"},"children":["Step 1"]},"."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"3-implement-the-display-information-handler","__idx":8},"children":["3. Implement the Display Information handler"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Display information"]}," step shows an information screen, as described in the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/guides/orchestration/journeys/display_information"},"children":["Display information"]}," step. Read the server payload from ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["response.data"]},". In this journey, ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["text"]}," contains the data collected in the previous step:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"data\": {\n    \"title\": \"Collected client information\",\n    \"text\": \"Here is what we got from the client side: {...}\",\n    \"button_text\": \"OK\"\n  }\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"javascript","header":{"controls":{"copy":{}}},"source":"function handleDisplayInformation(response) {\n  var actionData = response.data;\n  var title = actionData.title;\n  var text = actionData.text;\n  var buttonText = actionData.button_text;\n  // Display the title and text. When the user taps the button, continue the journey.\n  cordova.tsido.submitClientResponse(cordova.tsido.RESPONSE_OPTIONS.CLIENT_INPUT);\n}\n","lang":"javascript"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"step-4-complete-journey","__idx":9},"children":["Step 4: Complete journey"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Mosaic signals journey completion by setting ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["journeyStepId"]}," to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["cordova.tsido.STEPS.SUCCESS"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["cordova.tsido.STEPS.REJECTION"]},". The handlers are in ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#1-select-handler"},"children":["Select handler"]},". This example expects a successful response."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For authenticated journeys, successful completion can return an opaque code that your client passes to your backend. Your backend then exchanges that code for user tokens and enriched context, allowing it to establish a session, call downstream services, or run additional business logic with the authenticated user context. For details, see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/guides/orchestration/getting-started/journey_completion"},"children":["Journey completion for SDK journeys"]},"."]}]},"headings":[{"value":"Orchestration quickstart: Cordova","id":"orchestration-quickstart-cordova","depth":1},{"value":"Introduction","id":"introduction","depth":2},{"value":"Before you start","id":"before-you-start","depth":2},{"value":"Step 1: Install and initialize the SDK","id":"step-1-install-and-initialize-the-sdk","depth":2},{"value":"Step 2: Start journey","id":"step-2-start-journey","depth":2},{"value":"Step 3: Handle service response","id":"step-3-handle-service-response","depth":2},{"value":"1. Select handler","id":"1-select-handler","depth":3},{"value":"2. Implement the Hello World form handler","id":"2-implement-the-hello-world-form-handler","depth":3},{"value":"3. Implement the Display Information handler","id":"3-implement-the-display-information-handler","depth":3},{"value":"Step 4: Complete journey","id":"step-4-complete-journey","depth":2}],"frontmatter":{"markdown":{"toc":{"depth":2}},"seo":{"title":"Orchestration quickstart: Cordova"}},"lastModified":"2026-11-01T15:21:50.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/guides/orchestration/getting-started/quick_start_cordova","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}