Extension Configuration

The extension and its location must be declared in the recipedata/extensions section of the cook-config.yaml file. For example:

recipedata:
...
  extensions:
    ...
    - name: 'path-to/my-cue-front-extension'
...

The declaration must include either a name or a path parameter(or both), and one of them must specify the path of the extension (either a single file or a folder containing the extension files).If you specify both parameters, then path should contain the path, and name should contain just the name. For example:

recipedata:
...
  extensions:
    ...
    - name: 'my-cue-front-extension'
      path: 'path-to/my-cue-front-extension'
...

If you register your extension as an NPM module, then you will not need to specify a path – the name (including an optional scope prefix) is sufficient information for NPM to locate your extension. For more about this, see the NPM documentation.

If you need to control the order in which your extension is executed, then you can do so by specifying a numeric priority parameter:

recipedata:
...
  extensions:
    ...
    - name: 'my-cue-front-extension'
      path: 'path-to/my-cue-front-extension'
      priority: 10
...

Extensions with a priority setting are executed first, in priority order (low number to high number), followed by all unprioritized extensions (in alphabetic order). None of the default extensions are prioritized by default.

In addition to name, path and priority you can optionally add a config property. You can include any configuration properties you like as children of the config property. For an extension intended to retrieve data from an external web service, for example, you would probably want to add a property for specifying the web service URL:

recipedata:
...
  extensions:
    ...
    - name: 'my-cue-front-extension'
      path: 'path-to/my-cue-front-extension'
      priority: 10
      config:
        result-service-url: 'http://my-result-service.com/'
...