# Using AdapTable in interop.io

Canonical page: https://www.adaptabletools.com/docs/integrations-interop

- The interop.io Plugin is designed for when AdapTable is running inside [interop.io](https://interop.io/)
- It provides additional functionality for interop.io users including:
  - AdapTable's [Alerts](https://www.adaptabletools.com/docs/handbook-alerting/index.md) can appear as interop.io Notifications (together with actionable buttons)
  - [FDC3 Columns](https://www.adaptabletools.com/docs/handbook-fdc3/index.md) in AdapTable can communicate directly with other widgets (via FDC3 Intents)

This plugin was released in [AdapTable Version 18](https://www.adaptabletools.com/support/version-180-release-note), and supports AdapTable's integration with interop.io.

- In June 2023 Finsemble (Cosaic) and Glue42 merged to form [interop.io](https://interop.io/)
- In April 2024 AdapTable 18 **replaced** the previous standalone Finsemble and Glue42 plugins with this plugin

This plugin is for use when AdapTable sits inside [interop.io](https://interop.io/) and supports **both** [io.connect](https://interop.io/products/io-connect/) products:
- io.Connect Desktop
- io.Connect Browser

The key features that the plugin provides are:

- AdapTable's [Alerts](https://www.adaptabletools.com/docs/handbook-alerting/index.md) can appear as interop.io Notifications (together with actionable buttons)
- [FDC3 Columns](https://www.adaptabletools.com/docs/handbook-fdc3/index.md) in AdapTable can communicate directly with other widgets (via FDC3 Intents)

## Installing interop.io Plugin

npm install @adaptabletools/adaptable-plugin-interopio

If [using CommonJS](https://www.adaptabletools.com/docs/getting-started-installation/index.md#esm-and-cjs-formats), then install `@adaptabletools/adaptable-plugin-interopio-cjs` instead

## Setting up interop.io Plugin

Setting up the interop.io Plugin is a similar process to all the AdapTable plugins.

### Setting Up the interop.io Plugin

To set up the plugin and access the [interopio API](https://www.adaptabletools.com/docs/technical-reference-interop/index.md), follow these 6 steps:

The interop.io Plugin is available from @adaptabletools
Import these 2 files into your app from @adaptabletools/types:
- InteropioPluginOptions
- InteropioPluginAPI

 ```ts
 import interopio from '@adaptabletools/adaptable-plugin-interopio';
 import { InteropioPluginOptions } from '@adaptabletools/adaptable';
 import { InteropioApi } from '@adaptabletools/adaptable';
 ```

Create an [InteropioPluginOptions](https://www.adaptabletools.com/docs/technical-reference-interop/index.md) object to fit your needs.
Provide the necessary properties.

```ts
const interopioPluginOptions: InteropioPluginOptions = {
    showAdaptableAlertsAsNotifications: true,
  };
```

You need a reference to the current interop.io instance.

This object (returned via a Promise) can be either:

- Interop.IOConnectBrowser.API
- InteropDesktop.IOConnectDesktop.API

```ts
// get InteropAPI object
// type InteropAPI = Interop.IOConnectBrowser.API | InteropDesktop.IOConnectDesktop.API;
const interopioPromise = IOBrowser(webConfig);
const interopio = await interopioPromise;
```

Specify the plugin in [Adaptable Options](https://www.adaptabletools.com/docs/technical-reference-adaptable-options/index.md), passing in:

- the `InteropioPluginOptions` defined in step 2
- the interop instance defined in step 3

```ts
const adaptableOptions: AdaptableOptions = {
    adaptableId: 'interopDemo',
    plugins: [
      interopio(
        interopioPluginOptions, 
        interopio as any)
    ] 
}
```

If you are [using FDC3](https://www.adaptabletools.com/docs/handbook-fdc3/index.md), you will want to add the [FDC3 Options](https://www.adaptabletools.com/docs/handbook-fdc3/index.md) also.
Define any FDC3 Columns and Intents you require.

```ts
fdc3Options{
  // Options go here
}
```

Get hold of a reference to the [interop.io API](https://www.adaptabletools.com/docs/technical-reference-interop/index.md) for future use.

```ts
const interopApi = adaptableApi.pluginsApi.getInteropioPluginApi();
```

## interop.io Notifications

AdapTable automatically converts all [Alert Popups](https://www.adaptabletools.com/docs/handbook-alerting/index.md) into [interop.io Notifications](https://interop.io/desktop-notifications/).

At present the interop.io Notification Centre is only available on Windows

When this happens AdapTable will:
- display the Alert as an interop.io Notification
- convert all Alert Buttons to become interop.io Notification Action Buttons.

Turn this **off** by setting `showAdaptableAlertsAsNotifications` to *false* in [InteropioPluginOptions](https://www.adaptabletools.com/docs/technical-reference-interop/index.md)

## FDC3 in interop.io

interop.io is a leading contributor to the FDC3 standard, and their products offer extensive FDC3 integration.

It is expected that the interop.io Plugin will be used in conjunction with AdapTable's own [FDC3 features](https://www.adaptabletools.com/docs/handbook-fdc3/index.md).

This will enable users to create FDC3 Columns in AdapTable, and to raise Intents or broadcast Contexts that are listened to by other applications and widgets in io.connect.

To get best out of FDC3 while using interop.io we recommend you ensure that the interop.io version of FDC3 is running

### Running the interop.io FDC3 Package

interop.io provides its own [version of FDC3](https://docs.interop.io/browser/getting-started/fdc3-compliance/index.html) which is recommended to use if running AdapTable inside interop connect.

There are two ways to ensure that the interop.io FDC3 package is running:

- import the package via **npm** (the package is located [here](https://www.npmjs.com/package/@interopio/fdc3))
  
  

  npm install @interopio/fdc3

  

- import using a **script** tag

  ```html
  <script src="https://unpkg.com/@interopio/fdc3@latest/dist/fdc3.umd.js"></script>
  ```

## UI Entitlements

There are no specific [Entitlements](https://www.adaptabletools.com/docs/handbook-permissioning/index.md) required for the interop.io plugin.  

So long as the plugin is correctly set up and installed, everything should work normally.

### FAQ

**Do I need to use the interop plugin to use FDC3 in interop.io?**
No, if you only want to use FDC3 then AdapTable's comprehensive [FDC3 features](https://www.adaptabletools.com/docs/handbook-fdc3/index.md) are all you require.
Use the interop Plugin if you also want features like interop.io Notifications.
However we do recommend installing the interop.io FDC3 package (referenced above) for the best user experience.
