Web SDK migration guide

Theming changes

All old configurations linked with the previous theming setup (versions prior to 4.0) must be removed from your SDK deployment:

  1. Review Usage: Identify where you have applied theming v1 configurations in your project.

3.4.x example:

...
themePaths: {
    components: 'assets/theme/theme_components.json',
    tokens: 'assets/theme/theme_tokens.json',
...
},
  1. Update to Theming 4.0: Revise your theming configurations to use the latest theming v2 approach. Refer to our documentation or migration resources for guidance on transitioning to the new theming.

Theming setup

Learn more

Authorization token

  • AuthToken Management: The ui-sdk no longer relies on the authToken being stored in LOCAL_STORAGE. Instead, the ‘access_token’ is now passed as an input to the <flx-process-renderer> component through a private variable.

Breaking change: This update is mandatory for proper functionality of SSE (Server-Sent Events).

By adopting this approach, clients gain the flexibility to implement the most secure token management strategy tailored to their specific security needs. Moreover, shifting the responsibility to the container application for updating the ‘access_token’ input ensures that any changes or refreshes to the authToken are securely managed within the application’s domain. This proactive approach effectively mitigates potential security vulnerabilities associated with token management, offering a robust and adaptable solution.

Authorization

Learn more


iOS SDK migration guide

Integration changes

The module name has changed from FlowX to FlowXRenderer. Any files importing the SDK should be updated with the new module name.

//replace this
import FlowX

//with this
import FlowXRenderer

Initialization config changes

A new configuration parameter, named enginePath was added to FXConfig. It represents the URL path component to the process engine.

FXConfig.sharedInstance.configure { (config) in
    config.baseURL = myBaseURL
    config.enginePath = "engine"
    config.imageBaseURL = myImageBaseURL
    config.language = "en" 
    config.logLevel = .verbose
}

Theming changes

The theming setup mechanism was updated.

iOS Theming setup

Learn more

Custom components

  • The type of data property of custom components has changed from [String: Any] to Any.
  • As a consequence, type checking, casting and extracting the needed data must be part of the implementation details of the custom component.

Custom components

Learn more

Start process updates

  • The API for starting a process has changed.
  • There are now 3 methods available.

How to start a process

Learn more

Continue process updates

  • The API for resuming an existing process has changed.
  • There are now 3 methods available.

How to resume an existing process

Learn more


Android SDK migration guide

Initialization config changes

A new configuration parameter, named enginePath was added for identifying the FlowX Process Engine microservice.

When the SDK initialization happens through the FlowxSdkApi.getInstance().init(...) method, the argument has to be set inside the config: SdkConfig parameter value:

FlowxSdkApi.getInstance().init(
    ...
    config = SdkConfig(
        baseUrl = "URL to FlowX backend",
        imageBaseUrl = "URL to FlowX CMS Media Library",
        enginePath = "some_path",
        language = "en",
        validators = mapOf("exact_25_in_length" to { it.length == 25 }),
    ),
    ...
)

Authentication changes

The authentication mechanism has changed, so instead of passing the String value for the access token, a FlowxSdkApi.Companion.AccessTokenProvider must be used instead.

This provider is defined as a functional interface returning the actual value of the access token:

fun interface AccessTokenProvider {
    fun get(): String
}

Related changes:

  1. The provider can be passed if the business logic allows it when calling the FlowxSdkApi.getInstance().init(...).

As a consequence, the new signature for the FlowxSdkApi.getInstance().init(...) is:

fun init(
    context: Context,
    config: SdkConfig,
    accessTokenProvider: AccessTokenProvider? = null,
    customComponentsProvider: CustomComponentsProvider? = null,
)
  1. The FlowxSdkApi.getInstance().startProcess(...) accessToken parameter was dropped. It is not needed anymore, as the authentication will rely solely on the AccessTokenProvider.

The new signature of this method is:

fun startProcess(
    processName: String,
    params: JSONObject = JSONObject(),
    isModal: Boolean = false,
    closeModalFunc: ((processName: String) -> Unit)? = null,
): @Composable () -> Unit
  1. The FlowxSdkApi.getInstance().continueProcess(...) accessToken parameter was dropped. It is not needed anymore, as the authentication will rely solely on the AccessTokenProvider.

The new signature of this method is:

fun continueProcess(
    processUuid: String,
    isModal: Boolean = false,
    closeModalFunc: ((processName: String) -> Unit)? = null,
): @Composable () -> Unit
  1. The calls of the FlowxSdkApi.getInstance().updateAccessToken("some_access_token") method must be replaced by calls of the FlowxSdkApi.getInstance().setAccessTokenProvider(accessTokenProvider = { "some_access_token" }).

Whenever the access token changes based on your own authentication logic, it must be updated in the renderer by calling the setAccessTokenProvider method again.

Authentication mechanism

Learn more

Theming changes

The theming mechanism was replaced by a new approach, which enforces loading a theme before starting or resuming a process.

Related changes:

  1. The ai.flowx.android.sdk.process.model.SdkConfig theming related parameters (i.e. themeTokensJsonFileAssetsPath and themeComponentsJsonFileAssetsPath) were dropped.

Because of that, when configuring the library through the FlowxSdkApi.getInstance().init(...) method, the config parameter will look like this:

FlowxSdkApi.getInstance().init(
    ...
    config = SdkConfig(
        baseUrl = "URL to FlowX backend",
        imageBaseUrl = "URL to FlowX CMS Media Library",
        enginePath = "some_path",
        language = "en",
        validators = mapOf("exact_25_in_length" to { it.length == 25 }),
    ),
    ...
)
  1. For styling the UI components displayed when rendering a process while authenticated, the FlowxSdkApi.getInstance().setupTheme(...) method must be called before starting or resuming any process:
suspend fun setupTheme(
    themeUuid: String,
    fallbackThemeJsonFileAssetsPath: String? = null,
    @MainThread onCompletion: () -> Unit
)

This will fetch a priorly defined theme in the FlowX Designer, cache it and then load its properties.

A process should be started or resumed only after the onCompletion closure is called, signaling the completion of setting up the theme.

Theming mechanics

Learn more

Custom components changes

  1. All import ai.flowx.android.sdk.component.* directives must be changed to import ai.flowx.android.sdk.ui.components.*

  2. The type of the data parameter passed to a custom component through the populateUi(data: JSONObject) method, both for @Composable and for classical View system approaches, changed to Any?.

    Therefore, the new signature of the method is populateUi(data: Any?).

As a consequence, type checking, casting and extracting the needed data must be part of the implementation details of the custom component.

The value for the data parameter received in the populateUi(data: Any?) could be:

  • Boolean
  • String
  • java.lang.Number
  • org.json.JSONObject
  • org.json.JSONArray

Custom components

Learn more