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β
- Add entities β Plugin Entity Registration
- Add lifecycle hooks β Plugin Lifecycle
- Test your plugin β Plugin Testing
Related Pagesβ
- Plugin Overview β plugin system
- Plugin API Reference β full API