Skip to content

floross/nestjs-notion

Repository files navigation

Nestjs Notion

Description

Notion is a powerfull all in one workspace where you can use as a tool for your whole team to write, plan and get organized.

This package aims to wrap the notion API to a nestjs module.

Installation

npm i --save nestjs-notion

Add to your module

import { NotionModule } from 'nestjs-notion';

@Module({
  imports: [
    NotionModule.forRoot({
      auth: process.env.NOTION_TOKEN,
    }),
  ],
  providers: [],
  exports: [],
})
export class AppModule {}

Use it directly from any of your service

import { NotionService } from 'nestjs-notion';

@Injectable()
export class MyService {
  constructor(private readonly notion: NotionService) {}

  async getDatabasesList() {
    return this.notion.database.list();
  }
}

Roadmap

  • Add nestjs logger bridge between notion and a optional logger

Based on

This repository is based on Kamil Myśliwiec and @nestjs/graphql repository

License

MIT licensed.