Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Plugins Document #2746

Draft
wants to merge 2 commits into
base: release-5.8
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 32 additions & 11 deletions en_US/extensions/plugins.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
# Plugins

EMQX allows users to customize the business logic or implement other protocols using plugins written in Erlang. This page introduces how to develop a customized plugin.

The basic process of plugin development and operation is as follows:

- Download and install our [rebar3 emqx-plugin template](https://github.com/emqx/emqx-plugin-template).
- Generate the corresponding plugin tarball using the plugin template provided by EMQX.
- Install the plugin package via Dashboard or CLI.
- Start/stop/uninstall your plugin via Dashboard or CLI.
EMQX allows users to customize the business logic or implement other protocols using plugins written in Erlang. This page introduces how to develop, install, and maintain a customized plugin.

:::tip Prerequisite

Expand All @@ -16,7 +9,7 @@ Knowledge of EMQX [hooks](./hooks.md)

## Develop EMQX Plugins

This section provides a step-by-step guide on developing custom EMQX plugins, using the creation of an access control plugin as an example.
Developing plugins involves downloading and installing our [rebar3 emqx-plugin template](https://github.com/emqx/emqx-plugin-template) and generating the corresponding plugin tarball using the plugin template provided by EMQX. This section provides a step-by-step guide on developing custom EMQX plugins, using the creation of an access control plugin as an example.

### Download and Install the rebar3 Plugin Template

Expand Down Expand Up @@ -331,15 +324,27 @@ The following are several example snippets. For more detailed examples, refer to

Including Avro Schema and i18n files in your plugin package ensures they are incorporated during plugin compilation and packaging. You can use the `emqx_plugins:get_config/1,2,3,4` function in your plugin code to retrieve configuration settings.

## Install and Launch the Plugin
## Install and Uninstall a Plugin

Once you have developed a plugin, you can install the plugin package via Dashboard or CLI.

### Install a Plugin via Dashboard

### Install a Plugin via CLI

To install the compiled plugin package, use the command line interface (CLI) as follows:

```bash
./bin/emqx ctl plugins install {pluginName}
```

## Uninstall the Plugin
### Location of Installed Files

#### Beam files

#### Config/schema files

### Uninstall a Plugin

When the plugin is no longer needed, you can uninstall it using the CLI with this command:

Expand All @@ -348,3 +353,19 @@ When the plugin is no longer needed, you can uninstall it using the CLI with thi
```

<!-- **Note**: (EMQX enterprise) Plugins need to be reinstalled after hot upgrades. -->

## Maintain a Plugin

This section introduces how to start, stop and uninstall your plugin via Dashboard or CLI.

### Start and Stop a Plugin

### Upgrade a Plugin

### Configure a Plugin

#### Configure via Enterprise Dashboard

#### Configure via CLI

#### Configure via API