As you create an add-in for Interaction Connect, you will follow a basic set of steps for each one:
- Create a directory that will contain your add-in's files.
- Create a manifest.json file for your add-in using the following as an example.
- Create the main.js file for your add-in using the following as an example.
- Deploy your add-in alongside Interaction Connect using the instructions in deployment.
Example: manifest.json
The manifest.json file contains details for loading the add-in
{
"manifestVersion": 1,
"addinId": "com.inin.connect.testAddin"
}
Note:
- The
manifestVersion
must be set to 1. - The
addinId
must be a unique name for each add-in using the alpha-numeric and period format.
Example: main.js
The main.js file acts as the main entry point into an add-in. This means that calling APIs such as registering views or creating subscriptions can occur in this scope.
console.log("Hello world! I am running version", ININ.Addins.version, "of the add-in API.");
Note:
- The
ININ.Addins
namespace is available automatically for use from line 1. - Add-ins run in a limited-feature JavaScript environment known as a web worker that is in the Interaction Connect origin. For more information, see this article on Mozilla Developer Network.