Integration Main Module

The integration.js file is the main entry point to your integration on the Polarity server

Directory Structure

sample-integration/
└── integration.js

Summary

The integration.js file is the entry point into your integration on the server. The file runs on the server and is responsible for taking entities from the Polarity client, enriching or transforming them, and returning results back to the Polarity client.

The integration.js file runs in its own process on the Polarity Server so if your integration crashes it will not also crash the server.

At a minimum your main module must export a doLookup method but it can also provide a startup, validateOptions, onDetails, and onMessage method. Each of these methods must be exported from your main module so that they are accessible to the Polarity Server's integration loader.

The minimum integration.js file which will properly load is as follows:

integration.js
function doLookup(entities, options, cb){
    cb(null, []);
}

module.exports = {
    doLookup: doLookup
}

Method Hooks

The following table provides a summary of the special methods that can be implemented and exported from the integration.js file.

Last updated