Plugin configuration

The configuration of your plugin

Every Livestorm Plugin comes with a configuration file which allows you the specify some basic informations and also some advanced settings.

Here is the default configuration created:

module.exports = {
  "name": "my-plugin-name",
  "apiToken": "my-api-plugin",
  "metadata": {
    "logo": "https://uploads-ssl.webflow.com/60ad0f9314e628baa6971a76/60ec0b72f45280483f7957cf_Icon-Livestorm-Primary.svg",
    "translations": {
      "title": {
        "en": "My Plugin Title"
      },
      "description": {
        "en": "My Plugin Description"
      }
    }
  }
}

This is the minimum informations that are required by Livestorm but there are more. You can discover all of them right below.

name

(required) This is the identifier of your plugin. It should not be modified to make sure your updates are taken into account.

❗️

Don't change the name of your plugin

Unless you really want to change the plugin name for any reason, we strongly advice not to do that because you won't be able to update it further.

module.exports = {
  "name": "my-plugin-name"
}

apiToken

(required) This is the link between your plugin and the Livestorm workspace where you want to publish the plugin to.

To get one:

  1. Create a free Livestorm account
  2. Go to your new dashboard and generate a token
module.exports = {
  "apiToken": "my-api-token"
}

metadata

(required) This is the informations that will be displayed in the marketplace.

logo

The URL of the logo. We encourage you to use the SVG format. If you prefer PNG, the dimension should be 256x256 so that it render well for high resolution screens.

module.exports = {
    "metadata": {
        "logo": ":path/to/my-plugin-logo.svg"
    }
}

translations

An object that contains the translated title and description. English is required, French is strongly recommended and Spanish optional.

module.exports = {
    "metadata": {
        "translations": {
            "title": {
                "en": "My plugin",
                "fr": "Mon plugin",
                "es": "Mi plugin"
            },
            "description": {
                "en": "Useful to ...",
                "fr": "Utile pour ...",
                "es": "Sirve para ..."
            }
        }
    }
}

environments

It offers the possibility to create a development workflow as you probably use to use in your projects.
You might want to test and develop a plugin in a dedicated workspace before to publish it in your production workspace.

Get details explanation on the environments page.

module.exports = {
    "environments": {
        "development": {
            "scoped_to_event_ids": [
                "xxx",
                "yyy"
            ],
            "apiToken": "xxx",
            "name": "yyy"
        }
    }
}

// To publish on the development plugin, just make:
livestorm publish development

scoped_to_event_ids

It restricts the plugin to a specific event. By default, a plugin is executed on every events.

module.exports = {
	"scoped_to_event_ids": [
		"event_id_1",
		"event_id_2"
	],
}

permissions

It adds a server-side protection layer to a specific SDK API usage. Declaring permissions will restrict the usage of SDK API based on their key for specific profiles. It allows to make the plugin even more secure if malicious people were to edit a client-side request.

The SDK APIs:

  • storage
  • pubSub

The actions

  • write

The roles

  • teamMembers

For example, you want to protect the usage of a PubSub.Publish call in your plugin:
Livestorm.PubSub.Publish('event-1', something)

Simply use the following piece of config.:

module.exports = {
  'permissions': {
    'pubSub': { // SDK API
      'event-1': { // The key you set in your plugin
        'write': ['teamMembers'] // action with roles
       }
    }
  }
}