Question
In inherited code, I see calls like await Glue({...}) / await IODesktop({...}), but I can’t find any @interopio/desktop dependency in package.json or any <script> tag that loads it. How is this API loaded?
Answer
The JavaScript API is automatically injected into every window and attached to the global window object. io.Connect Desktop uses the @interopio/desktop library, which exposes a global factory function called IODesktop() when your app is running in an io.Connect Window (and supports the older Glue() factory function name for backward compatibility).
On the system level, io.Connect Desktop is told to inject a specific version of @interopio/desktop into every window via the windows.autoInjectAPI section in system.json - io.Connect Desktop Documentation - How to... > Interop-Enable Your Apps > JavaScript
How to check it?
-
Open your io.Connect Desktop
system.jsonfile for the environment you’re running. -
Find the
"windows"section and look for"autoInjectAPI". You should see something like:"windows": { "autoInjectAPI": { "enabled": true, "version": "5.11.2", "autoInit": false } }
The auto-injected bundles themselves are shipped with io.Connect Desktop and live under:
<installation_location>/interop.io/io.Connect Desktop/Desktop/assets/preloads