Directory Layout
Integrations should follow the suggested directory layout to improve readability
Suggested Directory Layout
The following shows a recommended directory layout for a Polarity integration called sample-integration
Subdirectories
/components
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.
/config
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
).
/styles
The styles directory is where you place your CSS or LESS file that can be used to apply custom styles to your integration template.
/templates
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
.
/test
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
).
/vendor
integration.js
package.json
README.md
Last updated