Create Plugins

sss

VitNode allows you to create your own plugins with own API endpoints and views. This is a powerful feature that allows you to extend the functionality of your application and share it with others.

Structure

You have 2 choices to create a plugin:

  • Create a new folder in the plugins directory inside monorepo (recommended),
  • Create a new repository and publish it as a package.

API Plugin

plugins/{name_plugin}/src/api/plugin.ts
import { createPluginApi } from 'vitnode/api/lib/plugin';
 
export const corePlugin = createPluginApi({
  name: 'core',
  modules: [],
});

On this page