Managing Assets

JS SDK comes with configurable options that enables developers to switch the working environment easily.

While downloading the SDK, imi-environments.js file comes pre configured with ‘default’ environment. The ‘default’ environment is based upon your setup at the platform.

This file can host multiple environments in JSON format.

var imiEnvironments = {
    "target": "default",
    "default": {
        "asset": {
            "appId": ‘<your App ID here>’,
            "appSecret":’<your secret here>’,
            "pathConfig": {
                "assetPath": "/assets/",
                "root": "/"




Specifies the current target environment for JS SDK. The environments are defined locally within the same file.


If the website is hosted within a sub-folder, use pathConfig parameter to specify folders:
var pathConfig = {
"assets": "/website_root/assets/",
"root": "/ website_root/"


Folder ‘assets’ is the relative path to JS SDK including ‘manifest’ folder. By default, this location is derived as
window.location.origin + '/assets';
//Sample Code:
"assets": "/website_root/assets/",


Folder containing ‘sw.j’s file.
Important! ‘sw.js’ file should always be in website root for Push notifications to work properly.