@interopio/desktop
6.20.1io.Connect Desktop is a desktop integration platform that enables functional and visual integration of web, native and legacy apps.
The io.Connect JavaScript library enables web apps to participate in io.Connect Desktop and use io.Connect functionalities via a set of APIs.
Referencing
From a JavaScript File
io.Connect JavaScript is a library available as a single JavaScript file, which you can include in your web apps using a <script> tag:
<script type="text/javascript" src="desktop.umd.js"></script>
When deploying your app in production, it's recommended to always reference a specific minified version:
<script type="text/javascript" src="desktop.umd.min.js"></script>
From an NPM Module
The io.Connect JavaScript library is also available as an npm package, which you can include as a dependency in your project and import in your code.
The currently available packages are @interopio/core and
@interopio/desktop.
The Core package is a subset of the Desktop package and offers basic functionalities for sharing data between apps
(Interop, Shared Contexts, Pub/Sub, Metrics),
while the Desktop package offers additional options for sharing data between apps (Channels), as well as advanced window management
functionalities (App Management, Layouts, Window Management).
To install the io.Connect library in your project, execute the following command:
npm install@interopio/desktop
Initialization
The io.Connect Desktop library registers a global factory function called IODesktop() that will resolve with the initialized API object when invoked:
import IODesktop from "@interopio/desktop";
const io = await IODesktop();
Optionally, you can provide configuration for the library:
import IODesktop from "@interopio/desktop";
// Enabling the Channels API.
const config = { channels: true };
const io = await IODesktop(config);
Runtime Globals
The following properties are injected in the global window object by io.Connect Desktop:
| Name | Type | Description |
|---|---|---|
iodesktop? |
IODesktopObject | Object injected in the global |
ioDesktopInfo? |
IODesktopInfo | Object injected in the global |