@interopio/core
Version:
IOConnect core library
32 lines (20 loc) • 1.39 kB
Markdown
# /core
## Overview
The [`/core`](https://www.npmjs.com/package/@interopio/core) library provides the basic io.Connect interoperability capabilities (Interop API, Shared Contexts API, Pub/Sub API, Logger API, and the legacy Metrics API) and is used internally by all other major io.Connect libraries like [`@interopio/desktop`](https://www.npmjs.com/package/@interopio/desktop), [`/browser`](https://www.npmjs.com/package/@interopio/browser), and more.
## Installation
To install the library, execute the following command:
```cmd
npm install /core
```
## Usage
The following example demonstrates basic initialization of the `/core` library.
> ℹ️ *For more details on using the capabilities provided by the `/core` library, see the respective sections in the **io.Connect Desktop** [official documentation](https://docs.interop.io/desktop/capabilities/launcher/index.html) or the **io.Connect Browser** [official documentation](https://docs.interop.io/browser/capabilities/home-app/overview/index.html).*
```javascript
import IOConnectCore from "@interopio/core";
// Use the initialized API object returned by the factory function to access the io.Connect APIs.
const io = await IOConnectCore();
// Using the io.Connect APIs.
await io.interop.register("myApp", () => {
console.log("Hello from myApp!");
});
```