Skip to main content

Set up and use a plugin

Learn how to use a plugin and its actions.

1. Create or find the plugin

Create a new plugin or select a plugin from the list of available open-source plugins that provides the actions you need.

Then, open the plugin repository in Codespaces or clone it on your local machine.

If you clone the plugin repository on your local machine, ensure you have the latest stable version of Node.js installed.

2. Install dependencies

To continue, you must install all the dependencies defined in the ./package.json file. Run the following command to install the dependencies.

npm install

3. Configure the plugin server

Copy the .env.example file to .env and update the environment variables with your values.

cp .env.example .env

Check the Plugin server configuration to learn more about the available environment variables.

4. Start the plugin server

Run the following command to start the plugin server.

npm start

The plugin server will start and listen on the 4201 port by default.

5. Expose the plugin server to the Internet

Important

Once you share the port and get the public URL of the plugin server, update the PLUGIN_SERVER_URL environment variable and restart the plugin server. This is required to make the OpenAPI spec of the plugin server work properly.

Share port on Codespaces

If you run the plugin server on GitHub Codespaces, you can share the 4201 port of the plugin server and make it accessible from the Internet. To share the port, follow the official Sharing port guide from GitHub.

Expose port from local machine

If you run the plugin server on your local machine, you can use ngrok to expose the port 4201 of the plugin server and make it accessible from the Internet. To expose the port, run the following command.

ngrok http 4201

The command will return a public URL that you can use to access the plugin server from the Internet.

6. Configure the client

Now, you can select the client from the list of supported clients and connect it to the plugin server using the connection string. In this way, the client will have access to the actions provided by the plugin, and you can start using them.

Follow instructions from the client documentation to connect it to the plugin server.