-
Notifications
You must be signed in to change notification settings - Fork 6
Home
Plugins use the Plugin Bridge and reference the hosted loader script (renamed to pluginBridge.min.js) to register the APIs. Plugins are hosted on a static server and are loaded into the Project Griffon UI as an iframe.
In order for a plugin to be loaded into the Project Griffon UI, the plugin must load the pluginBridge loader script and then register its apis.
The pluginBridge is hosted under the Griffon domain at /pluginBridge/pluginBridge.min.js. Place the following script tag in your plugin's HTML to load the bridge:
<script src="https://griffon.adobe.com/pluginBridge/pluginBridge.min.js"></script>
Currently the bridge provides the following methods to be registered by a plugin:
init
navigateTo
receiveEvents
receiveSelectedEvents
receiveSession
The plugin can register its implementation by running the following:
window.pluginBridge.register({
init: (settings) => {
// do something with settings like session name, IMS organization ID, IMS access token, etc.
},
navigateTo: (path) => {
// do something based on the current path of the Project Griffon UI
},
receiveEvents: (events) => {
// array of session events
},
receiveSelectedEvents: (eventUuids) => {
// array of session events
}
});
The bridge also exposes methods for the plugin to call into the Project Griffon UI.
annotateEvent,
navigateTo,
selectEvents,
sendCommand
The plugin can call these APIs by implementing something like the following:
window.pluginBridge.annotateEvent({ uuid: '1234567890', { debug: 'success' }}).then(() => {
console.log('Annotated Event Successfully!')
});
window.pluginBridge.selectEvents(['1234567890']).then(() => {
console.log('Event Selected Successfully!');
});
These apis are how plugins can communicate with other plugins. More info about the Plugin Bride APIs can be found in the Readme for the Plugin Bridge Repo