io.Connect Browser
4.0.0io.Connect Browser allows web apps to integrate with other apps that are part of the same io.Connect Browser project via a set of APIs. io.Connect Browser enables you to share data between apps, expose functionality, manage windows, notifications, and more.
Referencing
The @interopio/browser
library is available both as a single JavaScript file,
which you can include in your web apps using a <script>
tag, and also as a module, which you can import in your apps:
<script type="text/javascript" src="browser.umd.js"></script>
Or:
import IOBrowser from "@interopio/browser";
Initialization
The @interopio/browser
library attaches the IOBrowser()
factory function
to the global window
object. Invoke this function to initialize the library and connect to the io.Connect Browser environment.
The IOBrowser()
factory function accepts an optional Config
object as an argument, which you can use to provide settings for the library
(e.g., initialize additional io.Connect libraries, configure the library behavior or some of its APIs).
The factory function resolves with the initialized io.Connect API object, which you can use to access all available io.Connect APIs:
import IOBrowser from "@interopio/browser";
import IOWorkspaces from "@interopio/workspaces-api";
const initializeIOConnect = async () => {
// Initializing the Workspaces API.
const initOptions = {
libraries: [IOWorkspaces]
};
// Use the initialized API object to access the io.Connect APIs.
const io = await IOBrowser(initOptions);
// Here, the library is already initialized and you can access all available io.Connect APIs.
const myWorkspace = await io.workspaces.restoreWorkspace("My Workspace");
};
initializeIOConnect().catch(console.error);
APIobject
Description
Describes an instance of the initialized io.Connect library.
Properties
Property | Type | Default | Required | Description |
---|---|---|---|---|
agm | API | Interop library. |
||
appManager | API | App Management API. |
||
channels | API | Channels API. |
||
contexts | API | Contexts library. |
||
info | object | Info object containing versions of all included libraries and io.Connect itself. |
||
intents | API | Intents API. |
||
interop | API | Interop library. |
||
layouts | API | Layouts API. |
||
modals | API | Modals API. |
||
notifications | API | Notifications API. |
||
prefs | API | App Preferences API. |
||
search | API | Search API. |
||
themes | API | Themes API. |
||
version | string | io.Connect version. |
||
windows | API | Window Management API. |
||
workspaces | API | Workspaces API. |
Methods
donemethod
Signature
() => Promise<void>
Description
Disposes the io.Connect API. This will remove all Interop methods and streams registered by the application.
feedbackmethod
Signature
(info?: FeedbackInfo) => void
Description
Brings up the IOConnect Desktop feedback dialog.
Parameters
Name | Type | Required | Description |
---|---|---|---|
info | FeedbackInfo |
Configobject
Description
Describes the configuration for the IOBrowser()
factory function.
Properties
Property | Type | Default | Required | Description |
---|---|---|---|---|
contexts | ContextsConfig | Settings for the Contexts API. |
||
exposeAPI | boolean | true | Configures whether the library will share the initialized API object upon request via a custom web event. |
|
intentResolver | IntentResolverUIConfig | |||
intents | Config | Settings for the Intents Resolver UI. |
||
libraries | ((io: API, config?: Config | IOConnectDesktop) => Promise<void>)[] | List of references to the factory functions of additional io.Connect libraries to be initialized internally (e.g., |
||
memoizeAPI | boolean | false | If |
|
modals | ModalsUIConfig | Settings for the io.Connect modals. |
||
notifications | Settings | Settings for the Notifications API. |
||
systemLogger | SystemLogger | Configures the system logger. Used mostly during development. |
||
widget | WidgetConfig | Settings for the io.Connect widget. |
IntentResolverUIConfigobject
Properties
Property | Type | Default | Required | Description |
---|---|---|---|---|
awaitFactory | boolean | true | Whether to wait for IOBrowserIntentResolverUI factory to resolve |
|
enable | boolean | |||
timeout | number | 5000 | Timeout to wait for the IOBrowserIntentResolverUI factory to be fetched from the remote source |
ModalsUIConfigobject
Properties
Property | Type | Default | Required | Description |
---|---|---|---|---|
alerts | { enabled: boolean; } | Settings for the io.Connect alerts. |
||
awaitFactory | boolean | true | If |
|
dialogs | { enabled: boolean; } | Settings for the io.Connect dialogs. |
||
timeout | number | 5000 | Interval in milliseconds to wait for the |
SystemLoggerobject
Properties
Property | Type | Default | Required | Description |
---|---|---|---|---|
callback | (logInfo: any) => void | |||
level | IOConnectCore |
WidgetChannelsobject
Description
Settings for the Channel Selector UI.
Properties
Property | Type | Default | Required | Description |
---|---|---|---|---|
displayMode | WidgetChannelsDisplayMode | "all" | Determines which of the available Channels to display (all or only FDC3 ones). |
|
selector | WidgetChannelSelectorConfig | Settings for the Channel Selector UI. |
WidgetChannelSelectorConfigobject
Description
Settings for the Widget Channel Selector UI.
Properties
Property | Type | Default | Required | Description |
---|---|---|---|---|
enable | boolean | true | If |
|
type | WidgetChannelSelectorType | "default" | Type of the Channel Selector UI. |
WidgetConfigobject
Description
Describes the configuration for the io.Connect widget.
Properties
Property | Type | Default | Required | Description |
---|---|---|---|---|
awaitFactory | boolean | true | If |
|
channels | WidgetChannels | Settings for the Channel Selector UI. |
||
displayInWorkspace | boolean | false | If |
|
enable | boolean | If |
||
mode | WidgetMode | "default" | Mode for displaying the widget. |
|
position | WidgetPosition | "bottom" | Initial position for the widget within the window. |
|
timeout | number | 5000 | Interval in milliseconds to wait for the |
IOConnectBrowserFactoryFunctionfunction
Signature
(config?: Config) => Promise<API | IOConnectDesktop>
Description
Factory function that creates a new ioconnect instance. If your application is running in IOConnect Desktop this will return a Glue42.Glue API, which is a super-set of the IOConnectBrowser.API.
Parameters
Name | Type | Required | Description |
---|---|---|---|
config | Config |
WidgetChannelsDisplayModeenumeration
Description
Determines which of the available Channels to display (all or only FDC3 ones).
- "all"
- "fdc3"
WidgetChannelSelectorTypeenumeration
Description
Type of the Channel Selector to use in the widget.
- "directional"
- "default"
WidgetModeenumeration
Description
Mode for displaying the widget.
- "compact"
- "default"
WidgetPositionenumeration
Description
Initial position for the widget within the window.
- "top"
- "bottom"
- "left"
- "right"