Code generation for local testing

When setting up a journey, you can download a ready-to-use project that demonstrates how to integrate the journey into your application. This generated project provides a reference implementation for starting the journey, handling its responses, and interacting with Mosaic SDKs.

This feature simplifies the integration process by providing pre-configured code that requires minimal setup for testing and debugging (see Setting up an app). The generated code serves as a fully functional boilerplate, allowing you to stage the journey in a real-world environment. However, it must be integrated into the final application to ensure seamless operation within your project.

Benefits

The generated project provides a ready-to-use code sample tailored to your specific journey. It demonstrates how to integrate the journey, handle responses, and interact with Mosaic SDKs. While some execution logic is pre-configured and ready to run, minor configuration actions are required (see next section).

How it works

The generated project contains everything needed to invoke a journey and handle its execution. It includes:

  • Code to initialize and load SDKs.
  • Code to start all journey types, handle their steps, and process their responses.
  • Handling of different journey steps, including backend and client-facing steps.
  • Pre-configured integration with the required Mosaic SDKs.
Code generation in editor
Click to open the GIF in a dedicated tab.

Project content

Each project is generated based on the selected technology (TypeScript for web, Swift for iOS, or Kotlin for Android) and always includes the necessary setup for interacting with Mosaic. It is also pre-configured to use the appropriate SDK based on the platform (Web SDK, iOS SDK, Android SDK, React Native SDK).

The generated code can be downloaded as a ZIP file from the journey editor, with all required SDKs already integrated.
The only configuration needed is setting up the Mosaic tenant, which provides the Client ID required to identify your Mosaic tenant when running the app. More details in the next paragraphs.

Setting up an app

To set up a Mosaic app:

  1. Create an application in the Transmit Portal . All details in the creating applications guide.
  2. Create an OIDC client within the application. All details in the managing clients guide. Note that a Client ID is automatically generated for the app, which will be used in the following section.
  3. If your workflow involves user creation, enable user registration by setting Public sign-up to Allow registration .
  4. If you're using hosted solutions that require a redirect URI, add the appropriate URIs to the Redirect URIs field.
  5. Click Add to save your settings.

Specifying a Client ID

Once your Mosaic tenant is configured, the only action required to run the code is specifying the Client ID in the application's configuration file, located in the root directory: .env for TypeScript, TransmitSecurity.plist for iOS, app/res/values/strings.xml for Android.

Note

For a detailed description of each project, complete setup instructions, and how to run it, refer to the README.md file in the application's root directory.

Launching the app

To run the app:

  • For web, install dependencies and start the project using npm install && npm start .
  • For iOS, run pod install and build the app using Xcode.
  • For Android, open the project in Android Studio and sync dependencies.
Note

For a detailed description of how to run each project in its specific environment, refer to the README.md file in the application's root directory.

Before you run the code

Before running the downloaded project, you can use the Test Journey option in the Identity Journey editor. This feature provides a browser-based simulation of the journey, allowing you to test its behavior with different inputs.

  • Validates journey execution before local testing.
  • Allows input customization to simulate different scenarios.
  • Displays step-by-step execution to help debug logic.

This can be useful to verify that the journey logic is correct before running the generated project in a local environment.