Plugins

3 minute read

API Builder v4 introduces the concept of plugins. Plugins are regular node modules that are included in your API Builder project’s package.json file.

API Builder detects plugins by searching for installed modules with the api-builder-plugin- prefix. Scoped packages with this prefix will also be detected. These plugins can contain a mixture of different component types.

  • Flow-nodes
  • Flow-triggers
  • Middleware
  • API specifications
  • Schemas
  • Data connectors

Plugins which are released by Axway can be categorized by an additional prefix based on the components and functionality that they provide:

  • flow-nodes: api-builder-plugin-fn-
  • flow-triggers: api-builder-plugin-ft-
  • data connectors: api-builder-plugin-dc-

For information on the Plugins UI, refer to API Builder Console.

Configuration

Most plugins are configured using the pluginConfig key inside your application config. A lot of plugins will generate a config file upon install which may look like this:

module.exports = {
  pluginConfig: {
   "api-builder-plugin-myplugin": {
      // configuration goes here
    }
  }
}

When API Builder loads plugins, the configuration specific to each plugin (identified by name) will be provided on load. Plugins may or may not require configuration, but common settings may include authentication tokens/keys and other user-specific content.

Other plugins, such as api-builder-plugin-dc-, may use a slightly different or legacy method of configuration. Check the readme of individual plugins for specific details.

Compatibility

Since API Builder version Kabul, API Builder plugin compatibility can be defined using a semver range in engines.apibuilder in the plugin’s package.json.

This example shows that the plugin is compatible with API Builder version 4.63.0 and newer.

{
  "engines": {
    "apibuilder": ">=4.63.0"
  }
}

Attempting to install or use a plugin with an incompatible version of API Builder will result in an error on startup.

Creating your own plugins

We provide a method to create shareable plugins that contain flow-nodes for orchestration within the flow editor. For this, you can use the API Builder SDK.

Local plugins

There may be cases where you want to use a plugin in your project, which is not available publicly on npm - Possibly received in the form of a .tar.gz or developed locally.

npm allows for local dependencies using the “file:” protocol, and as of npm 5 will link file dependencies to preserve disk space.

  1. Extract and copy your plugin into any folder in your project, for example /plugins. The folder that the plugin lives in must match its package name. In this case, the plugin is called api-builder-plugin-myplugin.
  2. Navigate to the root directory of your application and run the following command to install the plugin as a local dependency.
npm install --no-optional plugins/api-builder-plugin-myplugin

Now, whenever you run an npm install, the local plugin and its dependencies will be installed alongside the rest of your app’s dependencies and will be available in your project.

Last modified August 26, 2022: Created release schedule (#101) (712a2f1)