> ## 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

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 CVA Risk Capital application.

## Activating Atoti CVA risk capital

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

   <Info>
     See the [Atoti UI tutorial](https://docs.activeviam.com/products/atoti/ui/5.2/docs/tutorial/setup) on how to set up the UI.
   </Info>

2. To activate Atoti CVA Risk Capital, make the following changes:

   In `package.json`:

   ```diff theme={"languages":{"custom":["/engine/python-sdk/0.9/languages/pycon.tmLanguage.json"]}}
   "dependencies": {
   +   "@activeviam/cvarc-sdk": 6.0.0,
   ...
     }
   ```

   In `index.tsx`:

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

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

   ```ts theme={"languages":{"custom":["/engine/python-sdk/0.9/languages/pycon.tmLanguage.json"]}}
   window.env = {
     contentServerVersion: "6.1.19",
     contentServerUrl: "http://localhost:9090/cvarc-application",
     activePivotServers: {
       CVARC: {
         url: "http://localhost:9090/cvarc-application",
         version: "6.1.19",
       },
     },
   };
   ```

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

## Configuring Atoti CVA risk capital

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

### Change the configuration

The [`configuration`](https://docs.activeviam.com/products/atoti/ui/5.2/docs/api/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 CVA Risk Capital 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/0.9/languages/pycon.tmLanguage.json"]}}
const extension: ExtensionModule = {
  activate: async (configuration) => {
    // default application name
    configuration.applicationName = "AtotiUI";
     ...
    // changes the application name to Atoti CVA Risk Capital
    activate({configuration});
    // Customized application name
    configuration.applicationName = "My Atoti CVA Risk Capital";
  },
};
```

### Change the settings

The `activate` function accepts a `settings` and a `basSettings` argument to let you configure the Atoti CVA Risk Capital 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/0.9/languages/pycon.tmLanguage.json"]}}
import { activate, settings, basSettings } from "@activeviam/cvarc-sdk";

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

For more information on the BAS settings, see [UI Components](https://docs.activeviam.com/products/tools/ui-components/5.2.14/online-help/).

## Combining Atoti CVA risk capital with other solutions or modules

To combine multiple solutions and modules, simply repeat the steps in the combined SDK's "Activating" section.

<Danger>
  You can only combine solution SDKs that have an Atoti UI peer dependency equal to 5.2.\*.
</Danger>

Example:

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

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