Create a plugin
Learn how to create a new plugin with actions.
Last updated
Was this helpful?
Learn how to create a new plugin with actions.
Last updated
Was this helpful?
The repository will be used to store the plugin code and configuration.
Use the CLI command to initialize the plugin repository with all the necessary files and configuration.
This command will also create a sample action for you to explore and test.
Open the ./src/actions
directory and find the newly created action file, define the input and output parameters of the action and implement the logic of the action in the handler
function.
Let's run the plugin's sample action to see how it works. This is helpful for testing the action during the development process.
Use the following command to run the action from the plugin server. You should receive a response with the result of the action execution. The plugin server must be running to run the action.
Run the following command to commit and push all the files to GitHub.
Make sure you delete all the secrets you might be using during testing before pushing the changes to the repository.
Use the CLI command to add a new action to the plugin.
Use the sample action as an example and draw inspiration from .
During the development, you may need to install additional packages. For example, the package to make HTTP requests to external APIs. To install it and add it to the ./package.json
file, run the following command:
In this example, we use the URL, http://localhost:4201
, along with the sample action name, sampleAction
, which was generated during initialization.
The action expects input parameters number1
and number2
. Additionally, we use the default to authenticate the request.
To continue, you must install all the dependencies defined in the ./package.json
file. Run the following command to install the dependencies.
Open the plugin repository in GitHub Codespaces or clone it on your local machine.
Run the following command to start the plugin server.
Check the documentation to learn more.