• Back to Glue42 Core Docs
Glue42 core documentation

Reference Documentation

  • Back to Glue42 Core Docs
Press/
  • Glue42 Web
  • AppManager
  • Channels
  • Intents
  • Interop
  • Layouts
  • Notifications
  • Shared Contexts
  • Themes
  • Windows
  • Workspaces

Glue42 Web

2.20.0

Glue42 Web allows JavasScript applications to integrate with other applications that are part of the same Glue42 Core project via a set of APIs. With Glue42 Web you can share data with other applications, expose functionality, manage windows and notifications.

Referencing

Glue42 Web is available both as a single JavaScript file, which you can include in your web applications using a <script> tag, and as a Node.js module:

<script type="text/javascript" src="web.umd.js"></script>

Or:

import GlueWeb from "@glue42/web";

When deploying your application in production, it is recommended to always reference a specific minified version:

<script type="text/javascript" src="web.umd.min.js"></script>

Initialization

Glue42 Web attaches a factory function to the global window object at runtime - GlueWeb(). It can be invoked with an optional configuration object to initialize the library and connect to the Glue42 Core environment. The factory function resolves with the glue API object:

const initializeGlue42 = async () => {
  // Initializing the Workspaces library.
  const initOptions = {
    libraries: [GlueWorkspaces]
  };

  // Use the object returned from the factory function
  // to access the Glue42 APIs.
  const glue = await GlueWeb(initOptions);

  // Here Glue42 Web is initialized and you can access all Glue42 APIs.
};

initializeGlue42().catch(console.error);

APIobject

Properties

Property Type Default Required Description
agm API

Interop library.

appManager API
channels API
contexts API

Contexts library.

info object

Info object containing versions of all included libraries and Glue42 itself.

intents API
interop API

Interop library.

layouts API
notifications API
search Glue42Search
themes API
version string

Glue42 version.

webPlatform Glue42Web
windows API
workspaces API

Methods

  • done
  • feedback

donemethod

Signature

() => Promise<void>

Description

Disposes Glue42 API. This will remove all Interop methods and streams registered by the application.

feedbackmethod

Signature

(info?: FeedbackInfo) => void

Description

Brings up the Glue42 Desktop feedback dialog.

Parameters

Name Type Required Description
info FeedbackInfo

Configobject

Properties

Property Type Default Required Description
contexts ContextsConfig

Enable, disable and configure the Contexts API. Enabled by default

exposeGlue boolean

Configures whether the Glue42 Web will share the initialized API object upon request via a custom web event. Defaults to true.

intents Config
libraries ((glue: API, config?: Config | Glue42) => Promise<void>)[]

A list of glue libraries which will be initiated internally and provide access to specific functionalities

notifications Settings

Configure the system logger. Used mostly for during development.

systemLogger SystemLogger

Configure the system logger. Used mostly for during development.

SystemLoggerobject

Properties

Property Type Default Required Description
callback (logInfo: any) => void
level Glue42Core

Glue42WebFactoryFunctionfunction

Signature

(config?: Config) => Promise<API | Glue42>

Description

Factory function that creates a new glue instance. If your application is running in Glue42 Enterprise this will return a Glue42.Glue API, which is a super-set of the Glue42Web API.

Parameters

Name Type Required Description
config Config
  • © 2023 Glue42
  • Home
  • Privacy policy
  • Contact Sales
  • Glue42.com
  • Tick42.com
  • Overview
  • API
  • Config
  • SystemLogger
  • Glue42WebFactoryFunction
Navigate
Go