How to...

Quick Guide

To Glue42 enable your app, you need to do 3 things:

  • reference the respective Glue42 library (JavaScript, .NET, Java, etc.);
  • initialize the Glue42 library;
  • create an app definition and add it to the Glue42 Enterprise configurations folder;

The following is an example of configuring a simple web app. Create your own basic web app or use this JavaScript test app skeleton and follow the steps in the guide below to test in practice how to Glue42 enable an app and add it to the Glue42 Toolbar. If you choose to use the provided test app skeleton, see the README file for instructions on how to run it.

See also how to reference and initialize Glue42 in a .NET, Java, React, Angular, Node.js, VBA, Delphi or Dash environment.

  1. Reference the Glue42 library file in a <script> tag. If you are using the example app skeleton provided above, the Glue42 library file is is named desktop.umd.js:
<script type="text/javascript" src="desktop.umd.js"></script>
  1. Initialize the Glue42 library.

To initialize the Glue42 library, place this code snippet in a <script> tag directly in the index.html or in the index.js file (which you have to reference in your index.html):

const init = async () => {
    window.glue = await Glue();
};

init().catch(console.error);

Your index.html should now look something like this:

<body>
    <h1>My Test App</h1>
    <div>
        <p>
            Some Data
        </p>
    </div>
</body>
<script type="text/javascript" src="desktop.umd.js"></script>
<script>
    const init = async () => {
        window.glue = await Glue();
        console.log(`Glue42 initialized successfully!\nGlue42 version: ${glue.version}`);
    };

    init().catch(console.error);
</script>
  1. Create an app definition.

To add your 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). If you are using the provided test app, you can simply copy the provided js-test-app.json configuration file to that location. Otherwise, see below how to create a quick and simple app definition:

{
    "name": "test-app",
    "title": "My Test App",
    "type": "window",
    "details": {
        "url": "http://localhost:3333/index.html",
        "mode": "tab",
        "width": 500,
        "height": 400
    }
}

The "name", "type", "details" and "url" properties are required.

  1. Start your app.

Now you can start your app from the Glue42 Toolbar. You can open the console of the app window by pressing F12 to see the printed successful initialization message. You can also start exploring the Glue42 APIs by accessing the glue object that was attached to the global window object during initialization.

That's it! You now have your first Glue42 enabled app!

For more advanced configuration settings, visit the Configuration section.

See also: