UI Activation

Each UI project is designed as an extension of the Atoti UI “host application”. This section explains how you can easily combine these extensions into a running Atoti FRTB application.

Activating Atoti FRTB

  1. Download and set up the latest version of the Atoti UI starter application. See the Atoti UI tutorial here.

  2. To activate Atoti FRTB, make the following changes:

    In package.json:

    "dependencies": {
    +   "@activeviam/frtb-sdk": 5.2.0,
     ...
      }
    

    In index.tsx:

    + import { activate } from "@activeviam/frtb-sdk";
    
    const extension: ExtensionModule = {
      activate: async (configuration) => {
        ...
    +    activate({configuration});
      }
    }
    

    In env.development.js and env.production.js, ensure the following exist:

    • A server used as the Content Server
    • An Atoti FRTB server with the key “FRTB”

    These elements could refer to the same server. For example:

    window.env = {
      contentServerVersion: "5.10.0",
      contentServerUrl: "http://localhost:8080/frtb-starter",
      activePivotServers: {
    FRTB: {
      url: "http://localhost:8080/frtb-starter",
      version: "5.10.0",
        },
      },
    };
    
  3. Build and run the starter, now with the Atoti FRTB features enabled.

Configuring Atoti FRTB

The example above activates Atoti FRTB with a default configuration and default settings. Here’s how to modify them.

Change the configuration

The configuration parameter is the entry-point to configuring the Atoti UI “host application”. It is supplied to the activate function that modifies it to add the Atoti FRTB features. If you want to make changes like adding or removing a plugin, changing the application’s title or adding an HOC, you can modify the configuration object after invoking activate.

For example:

const extension: ExtensionModule = {
  activate: async (configuration) => {
    // default application name
    configuration.applicationName = "AtotiUI";
     ...
    // changes the application name to Atoti FRTB
    activate({configuration});
    // Customized application name
    configuration.applicationName = "My Atoti FRTB";
  },
};

Change the settings

The activate function accepts a settings and a basSettings argument to let you configure the Atoti FRTB features and the BAS features respectively. You can use the default values exported from the SDK as an override basis:

import { activate, settings, basSettings } from "@activeviam/frtb-sdk";

const extension: ExtensionModule = {
  activate: async (configuration) => {
    ...
    activate({
      configuration
      settings: {
        ...settings,
        ...{
          // customize here
        }
      },
      basSettings: {
        ...basSettings,
        ...{
          // customize here
        }
      }
    });
  },
};

For more information:

Combining Atoti FRTB with other solutions or modules

To combine multiple solutions and modules, simply repeat the steps in the combined SDK’s “Activating” section.

warning

You can only combine solution SDKs that have an Atoti UI peer dependency equal to 5.1.*.

Example:

import { activate as frtbActivate } from "@activeviam/frtb-sdk";
import { activate as mrActivate } from "@activeviam/mr-sdk";

const extension: ExtensionModule = {
  activate: async (configuration) => {
    ...
    frtbActivate({ configuration });
    mrActivate({ configuration });
  },
};