Glue42 Enterprise is now io.Connect Desktop! The new documentation site for all interop.io products is located at docs.interop.io.

How to...

Referencing

The Glue42 JavaScript library is available as a single JavaScript file, which you can include in your apps. If you are using a Glue42 installer, you can find the JavaScript files in %LOCALAPPDATA%\Tick42\GlueSDK\GlueJS\js. When deploying your app in production, it is recommended to always reference a specific minified version:

import Glue from "../scripts/desktop.umd.min.js";

The Glue42 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 @glue42/core and @glue42/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 include any of the packages as a dependency in your project, navigate to the root directory of your project and run:

npm install @glue42/desktop

To reference the Glue42 library:

const Glue = require("@glue42/desktop");

Initialization

If your Node.js app is started by Glue42 Enterprise, it isn't required to pass authentication information in the optional configuration object passed to the factory function:

const Glue = require("@glue42/desktop");

// This will prevent the app from exiting when Glue42 is initialized.
// Remove in real apps.
setTimeout(()=>{
    console.log("Done.");
}, 10000);

const initializeGlue42 = async () => {
    // Optional configuration for intializing the library.
    const config = { activities: false };

    // Use the object returned by the factory function to access the Glue42 APIs.
    const glue = await Glue(config);

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

    console.log(`Glue42 version: ${glue.version}`);
};

initializeGlue42().catch(console.error);

App Configuration

To add your Node.js app to the Glue42 Toolbar, you must create a JSON file with app configuration. Place this file in the %LocalAppData%\Tick42\UserData\<ENV>-<REG>\apps folder, where <ENV>-<REG> must be replaced with the environment and region of your Glue42 Enterprise copy (e.g., T42-DEMO).

The following is an example configuration for a Node.js app:

{
    "name": "node-server",
    "type": "node",
    "service": true,
    "details": {
        "path": "%GDDIR%/PathToMyServer/index.js",
        "showConsole": true
    }
}

The "name", "type" and "path" properties are required and "type" must be set to "node". The "path" property points to a JavaScript file that Glue42 Enterprise will execute in a Node.js environment.

For details on how to configure a remotely hosted Node.js app, see the Developers > Configuration > Application section.

For details on how to use different Node.js versions, see the Using Different Node.js Versions section.

Glue42 JavaScript Concepts

Once the Glue42 JavaScript library has been initialized, your app has access to all Glue42 functionalities. For more detailed information on the different Glue42 concepts and APIs, see:

Reference

For a complete list of the available JavaScript APIs, see the Glue42 JavaScript Reference Documentation.