SDK reference · Cordova SDK / Cordova Common Implementation Patterns

Common Implementation Patterns

This section describes the three most common ways to integrate the Incode Onboarding Cordova Plugin. The patterns differ in two ways: where the flow is defined (in your app code versus on the Incode Dashboard) and how much control your host application keeps while the flow runs.

This page explains each pattern and when to use it. Pick the one that fits your product, then follow its dedicated page for the full walkthrough.

Where flows are defined

The three patterns split into two configuration models:

  • Configured locally. You build a flowConfig array in code, adding the modules you want and the order they run in. Patterns 1 and 2 use this model. See Modules for the catalog of modules you can add and the per-module configuration parameters.
  • Configured online. The flow is defined on the Incode Dashboard as a Workflow or a Flow. Your code references it by ID, so you can change the configuration on the dashboard without shipping a new app build. Pattern 3 uses this model.

The three patterns

1. Configure flows locally and run end to end

Build a flowConfig in code, then hand the whole flow to the SDK with a single startOnboarding() call. The SDK runs every module in sequence and returns control to your app when the flow finishes.

Use this when you want the simplest integration and the SDK can own the full onboarding experience from start to finish.

Walkthrough: Configure Flows Locally and Run End to End

2. Configure flows locally and run step by step

Build the flow as one or more sections in code and run each section with startOnboardingSection(). Control returns to your host application between sections, so you can insert your own screens, run business logic, or branch the flow based on intermediate results before starting the next section.

Use this when you need to interleave your own UI or logic with the SDK modules, or split a long flow into discrete steps.

Walkthrough: Configure Flows Locally and Run Step by Step

3. Run flows configured online

Define the flow on the Incode Dashboard, then start it with startWorkflow() or startFlow(). The SDK pulls the modules and configuration from the dashboard, so you do not define a flowConfig locally.

Incode distinguishes between Workflows (governed by Conditions) and Flows (governed by the Rules Engine). startWorkflow() runs the former; startFlow() runs the latter. See the walkthrough for the distinction and when to use each.

Use this when you want to change the onboarding configuration from the dashboard without releasing a new app version.

Walkthrough: Run Flows Configured Online

Choosing a pattern

If you want to... Use Entry point
Run a full flow with the least code Configure locally, run end to end startOnboarding()
Insert your own screens or logic between SDK steps Configure locally, run step by step startOnboardingSection()
Change the flow from the dashboard without an app release Run flows configured online startWorkflow() or startFlow()

All three patterns require that the SDK is initialized first. See Installation for the initializeSDK() call and its arguments.

Sample app

A complete, runnable example covering all three patterns is available in the CordovaSampleApp repository. Clone it, add your Incode credentials, then build and run on a device. See the repository README for full setup instructions.

  • Modules: the module catalog for building a flowConfig.
  • Results: the result and error objects returned when a flow finishes.
  • API Reference: full signatures for every method mentioned on this page.

Was this page helpful?