open-index/open-npm huggingface dataset:
npm package: @interopio/intent-resolver-ui
Description: The [`@interopio/intent-resolver-ui`](https://www.npmjs.com/package/@interopio/intent-resolver-ui) library provides a default implementation of the io.Connect Intent Resolver for **io.Connect Browser** projects and also enables you to create your own cust
Latest version: 4.3.0

# @interopio/intent-resolver-ui

## Overview

The [`@interopio/intent-resolver-ui`](https://www.npmjs.com/package/@interopio/intent-resolver-ui) library provides a default implementation of the io.Connect Intent Resolver for **io.Connect Browser** projects and also enables you to create your own custom Intent Resolver app by extending the library configuration.

The io.Connect Intent Resolver app provides a UI which enables end-users to manually select an Intent handler when an Intent is raised and multiple apps or already running app instances are available to fulfill the request.

## Installation

To install the library, execute the following command:

```cmd
npm install @interopio/intent-resolver-ui
```

## Usage

In an **io.Connect Browser** project, the Intent Resolver app is configured and initialized in the Main app, which then provides the Intent Resolver to all Browser Client apps that have enabled its usage.

> ℹ️ *For more details on using the `@interopio/intent-resolver-ui` library, see the **io.Connect Browser** [official documentation](https://docs.interop.io/browser/capabilities/data-sharing/intents/overview/index.html#intent_resolver)*

Configuring and initializing the Intent Resolver in the Main app:

```javascript
import IOBrowserPlatform from "@interopio/browser-platform"

const config = {
    licenseKey: "my-license-key",
    // Settings for the Intent Resolver.
    intentResolver: {
        sources: {
            // It's required to specify the locations of the bundle and styles for the Intent Resolver.
            bundle: "https://my-intent-resolver/intent-resolver-bundle.js",
            styles: ["https://my-intent-resolver/styles.css", "https://example.com/custom-styles.css"],
            // It's required to specify the locations of the fonts when using the default Intent Resolver.
            fonts: ["https://my-intent-resolver/fonts.css"]
        }
    },
    browser: {
        // Enabling the Main app to use the Intent Resolver.
        intentResolver: {
            enable: true
        }
    }
};

const { io } = await IOBrowserPlatform(config);
```

Enabling the usage of the Intent Resolver in a Browser Client app:

```javascript
import IOBrowser from "@interopio/browser";

const config = {
    intentResolver: {
        // Enabling the Intent Resolver for the current Browser Client app.
        // It's required to specify this to be able to use the Intent Resolver.
        enable: true
    }
};

const io = await IOBrowser(config);
```