OrbisDB Plugins allow users to customize and enrich the behavior of their instance. This can be done by generating new streams, adding data to existing streams, validating them or doing actions after the stream has been processed.

Plugin structure

OrbisDB Plugins are Javascript classes. They currently live in the server/plugins folder and need to be added manually. Any dependencies are installed to the root OrbisDB folder.

OrbisDB Plugin architecture is a work in progress. There are plans to make Plugins isolated ES modules that can be installed using package managers, instead of being stored in the OrbisDB folder.

File structure

All plugins have at least 3 main files

Hooks

Plugins expose functionality based on hooks. There are currently 4 hook types

Routes

Plugins can also expose API routes. These are added to the main Fastify instance and are namescoped to you Plugin’s ID.

Available HTTP methods that can be used are GET, POST, PUT, PATCH and DELETE.

Settings

Plugins have to define a settings.json file. These define the plugin’s ID, metadata, hook and route information as well as any dynamic variables.

Dynamic variables allow you to use user input inside your Plugin’s methods.

Variable types