Tyk OAS API Plugin Bundle Configuration
Last updated: 3 minutes read.
For API plugins that are deployed as plugin bundles, the API should be configured with the name of the plugin bundle file to download from your remote web server. Furthermore, the Gateway should be configured to enable downloading plugin bundles.
You can configure your API with the name of the plugin bundle file to download within the Tyk OAS API definition or API Designer.
If you’re using the legacy Tyk Classic APIs, then check out the Tyk Classic page.
Configuring Plugin Bundles in the Tyk OAS API Definition
The configuration for a Tyk OAS API to fetch the download of a plugin bundle from a remote web server is encapsulated within the pluginConfig
section within the middleware.global
section of the x-tyk-api-gateway
part of a Tyk OAS API Definition.
The pluginConfig
section is structured as follows:
bundle
: A JSON entity that contains the following configuration parameters:enabled
: Whentrue
, enables the plugin.path
: The relative path of the zip file in relation to the base URL configured on the remote webserver that hosts plugin bundles.
driver
: Indicates the type of plugin, e.g.golang
,grpc
,lua
,otto
orpython
.
An illustrative example is listed below:
|
|
In this example we can see that bundle plugin has been configured within the middleware.global.pluginConfig.bundle
object. The plugin is enabled and bundled within file plugin.zip
. The plugin bundle is a Go plugin, i.e. middleware.global.pluginConfig.driver
has been configured with value goplugin
.
The configuration above is a complete and valid Tyk OAS API Definition that you can import into Tyk to try out custom plugin bundles, assuming that you have provided a valid bundle file named plugin.zip
.
Configuring Plugin Bundles in the API Designer
To configure plugin bundles for Tyk OAS APIs click on the APIs menu item in the API Management menu of Dashboard and select your API to display the editor screen. Subsequently, follow the steps below:
Step 1: Access plugin options
Scroll down until the Enable Plugin section is displayed.
Step 2: Enable plugin bundle for you API
Enable a plugin bundle for your API by activating the toggle switch.
Step 3: Enter relative path to plugin bundle file
Enter the relative path of the plugin bundle file in the Plugin Bundle ID field that Tyk Gateway should download from the web server that hosts your plugin bundles.
Step 4: Save the API
Select Save API to apply the changes to your API.