> ## Documentation Index
> Fetch the complete documentation index at: https://docs.activeviam.com/llms.txt
> Use this file to discover all available pages before exploring further.

# UI Activation

> Guide to activating Atoti Market Risk in an Atoti UI host application, covering the mr-sdk setup steps, configuring the activate function, customizing settings and BAS settings, and combining with other Atoti solution SDKs.

Atoti Market Risk extends the Atoti UI host application via the mr-sdk, activated by importing and calling the `activate` function in the Atoti UI starter.

## Activating Atoti Market Risk

1. Download and set up the latest version of the Atoti UI starter application. See the Atoti UI tutorial [here](https://docs.activeviam.com/data-visualization/atoti-ui/latest/developer-guide/install-and-start/set-up.md).
2. To activate Atoti Market Risk, make the following changes:

   In `package.json`:

```diff theme={"languages":{"custom":["/engine/python-sdk/6.2/languages/pycon.tmLanguage.json"]}}
"dependencies": {
+   "@activeviam/mr-sdk": 6.0.7,
+   "@tanstack/react-query": ^5.8.1,
 ...
  }
```

In `index.tsx`:

```diff theme={"languages":{"custom":["/engine/python-sdk/6.2/languages/pycon.tmLanguage.json"]}}
+ import { activate } from "@activeviam/mr-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 Market Risk server with the key "MR"

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

```ts theme={"languages":{"custom":["/engine/python-sdk/6.2/languages/pycon.tmLanguage.json"]}}
window.env = {
  contentServerVersion: "6.0.4",
  contentServerUrl: "http://localhost:10010/mr-application",
  activePivotServers: {
    MR: {
      url: "http://localhost:10010/mr-application",
      version: "6.0.4",
    },
  },
};
```

3. Build and run the starter, now with the Atoti Market Risk features enabled.

## Configuring Atoti Market Risk

The example above activates Atoti Market Risk with a default configuration and default settings.
Here's how to modify them.

### Change the configuration

The [`configuration`](https://docs.activeviam.com/data-visualization/atoti-ui/5.2/developer-guide/reference/types#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 Market Risk 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:

```ts theme={"languages":{"custom":["/engine/python-sdk/6.2/languages/pycon.tmLanguage.json"]}}
const extension: ExtensionModule = {
  activate: async (configuration) => {
    // default application name
    configuration.applicationName = "AtotiUI";
     ...
    // changes the application name to Atoti Market Risk
    activate({configuration});
    // Customized application name
    configuration.applicationName = "My Atoti Market Risk";
  },
};
```

### Change the settings

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

```ts theme={"languages":{"custom":["/engine/python-sdk/6.2/languages/pycon.tmLanguage.json"]}}
import { activate, settings, basSettings } from "@activeviam/mr-sdk";

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

For more information:

* Atoti Market Risk settings, see [UI settings](https://docs.activeviam.com/solutions/market-risk/6.0/dev/dev-ui-config/ui-settings.md).
* BAS settings, see [UI Components](https://docs.activeviam.com/solutions/libraries/ui-components/5.2.22/overview.md).

## Combining Atoti Market Risk 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:

```ts theme={"languages":{"custom":["/engine/python-sdk/6.2/languages/pycon.tmLanguage.json"]}}
import { activate as mrActivate } from "@activeviam/mr-sdk";
import { activate as frtbActivate } from "@activeviam/frtb-sdk";

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