Directory Layout
Integrations should follow the suggested directory layout to improve readability
Last updated
Integrations should follow the suggested directory layout to improve readability
Last updated
The following shows a recommended directory layout for a Polarity integration called sample-integration
The components directory contains a component file that allows logic to be implemented and data to be manipulated on the client side of the integration (i.e., within the notification window). Components are typically used to format data on the client, or to receive user actions from the notification window.
The config file allows you to specify a large range of properties for your integration including logging and user options. The config filename and path cannot be modified (the config file must always be /config/config.js
).
The styles directory is where you place your CSS or LESS file that can be used to apply custom styles to your integration template.
The templates directory contains your integration template written using the Handlebars templating language. Handlebars enhances HTML by providing intuitive syntax for mixing static HTML content with dynamic integration content inside curly braces {{ }}
. Handlebars also provides basic programming logic such as if/then/else
statements and loops
.
The test directory is where unit, integration, and acceptance tests should be placed. The test
directory name should not be modified (i.e., it should always be called test
).
The vendor directory is where you should place any javascript files you want loaded with the integration. Any files placed here should be listed under the javascript
property of the configuration file as specified in the .
The integration.js
file is the main module file and entry point for your integration. The name of this file must match the main
property set in your file.
The package.json
file is used to configure the dependencies of your integration. The package.json
file follows the same rules and conventions followed by the NPM package.json
file (integration dependencies are actually installed using NPM). You can learn more about NPM package.json
files on the official
For the Polarity specific guide
The README.md
file is a markdown file that documents your integration. You should provide an overview of what your integration does and the different configuration options. The markdown file should be written using GitHub flavored markdown. You can learn more about the markdown syntax by reading the "" guide on GitHub.