Skip to content
On this page

Creating and Sharing a Plugin with the RPGJS Community

Step 1: Generate a Plugin Module

Generate a new plugin module by running the following command in your terminal:

npx rpgjs generate module myplugin

This will create a new directory named myplugin with the following structure:

    ├── client
    │   └── index.ts
    ├── server
    │   └── index.ts
    ├── index.ts
    ├── config.json
    └── package.json

Step 2: Naming Your Plugin

Make sure the name of your plugin package starts with rpgjs-. For example, you might name your plugin rpgjs-myplugin.

Step 3: Understanding Autoload

The creation of the plugin does not utilize an autoload file, but instead, you will be required to create a module.

Step 4: Configuring the Plugin

The config.json file at the root of your plugin directory will indicate what developers must or can put into their rpg.toml configuration file. You can then retrieve a configuration for server-side, client-side, or both from the module.

Here's an example of what the config.json file might look like:

  "namespace": "myplugin",
  "server": {
    "type": "object",
    "properties": {
        "provider": {
            "type": "string"
    "required": [
  "client": {},
  "*": {}


To write properties, use JSON Schema. If you're not familiar, use an AI like ChatGPT 😃


You can set configuration options for your plugin within the rpg.toml file, using the structure defined in your config.json file. Based on the above example, you might add the following to rpg.toml:

   provider = '...'

In code, you can find the configuration with: /api/RpgClientEngine.html#globalconfig. Example:

In myplugin/server/index.ts

import { RpgServerEngine } from '@rpgjs/server';
import { RpgServer, RpgModule } from '@rpgjs/server';

    engine: {
        onStart(server: RpgServerEngine) {
export default class RpgServerModuleEngine {}

Step 6: Sharing with the Community

Once you've created and tested your plugin, you can share it with the RPGJS community by publishing it to a package repository like npm.

cd myplugin
npm publish


Feel free to make a pull request on the RPGJS repository to share your plugin. Or tell us about it on the forum!