ื“ืœื’ ืœืชื•ื›ืŸ ื”ืจืืฉื™

Plugin Development Quickstart

Create a custom plugin for Ever Gauzy in 10 minutes.

Prerequisitesโ€‹

  • Node.js 20+
  • Gauzy development environment set up
  • Understanding of NestJS modules

Step 1: Generate Plugin Skeletonโ€‹

mkdir packages/plugins/my-awesome-plugin
cd packages/plugins/my-awesome-plugin

Create the file structure:

my-awesome-plugin/
โ”œโ”€โ”€ src/
โ”‚ โ”œโ”€โ”€ index.ts
โ”‚ โ”œโ”€โ”€ my-awesome-plugin.module.ts
โ”‚ โ”œโ”€โ”€ my-awesome-plugin.service.ts
โ”‚ โ””โ”€โ”€ my-awesome-plugin.controller.ts
โ”œโ”€โ”€ package.json
โ””โ”€โ”€ tsconfig.json

Step 2: Define the Moduleโ€‹

// src/my-awesome-plugin.module.ts
import { Module } from "@nestjs/common";
import { MyAwesomeService } from "./my-awesome-plugin.service";
import { MyAwesomeController } from "./my-awesome-plugin.controller";

@Module({
controllers: [MyAwesomeController],
providers: [MyAwesomeService],
exports: [MyAwesomeService],
})
export class MyAwesomePluginModule {}

Step 3: Create a Serviceโ€‹

// src/my-awesome-plugin.service.ts
import { Injectable } from "@nestjs/common";

@Injectable()
export class MyAwesomeService {
getHello(): string {
return "Hello from My Awesome Plugin!";
}
}

Step 4: Add a Controllerโ€‹

// src/my-awesome-plugin.controller.ts
import { Controller, Get } from "@nestjs/common";
import { MyAwesomeService } from "./my-awesome-plugin.service";

@Controller("my-awesome")
export class MyAwesomeController {
constructor(private readonly service: MyAwesomeService) {}

@Get()
hello() {
return this.service.getHello();
}
}

Step 5: Register the Pluginโ€‹

Add to packages/core/src/app.module.ts:

import { MyAwesomePluginModule } from "@gauzy/plugin-my-awesome";

@Module({
imports: [
// ... other modules
MyAwesomePluginModule,
],
})
export class AppModule {}

Step 6: Testโ€‹

yarn start:api
curl http://localhost:3000/api/my-awesome
# โ†’ "Hello from My Awesome Plugin!"

Next Stepsโ€‹