Publishing
Once you have developed a plugin and tested it locally, you can publish it to the NPM registry for others to install and use. We recommend publishing your plugin to the public NPM registry to make it available to the community.
Prerequisites
- Node.js (opens in a new tab) (v18 or higher)
- pnpm (opens in a new tab) (v6.14.1 or higher)
- npm account (opens in a new tab)
Step 1: Prepare your plugin
After you have developed and tested your plugin locally, you need to prepare it for publishing.
- Update the version: Update the version number in the
package.json
file. - Build the plugin: Run the build command to generate the production build of your plugin.
Make sure you have set platformType
in package.json
to match the platform you are building for.
package.json
{
"name": "botmate-plugin-example",
"version": "1.0.0",
"main": "lib/server/index.js",
"botmate": {
"platformType": "telegram"
}
}
pnpm build
Step 2: Publish your plugin
Once you have prepared your plugin, you can publish it to the NPM registry.
- Login to NPM: Run the following command to login to your NPM account.
npm login
- Publish the plugin: Run the following command to publish your plugin to the NPM registry.
npm publish
Step 3: Verify the plugin
After publishing your plugin, you can verify it by installing it in a new project.
- Create a new project: Create a new project and install your plugin using the following command.
npm install [plugin-name]
- Verify the installation: Verify that your plugin is installed correctly and working as expected.
Step 4: Share your plugin
Once you have verified your plugin, you can share it on our marketplace (opens in a new tab).