JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q35974F
  • License MIT

Notion module for nest.js

Package Exports

  • nest-notion

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (nest-notion) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

nest-notion

Nest module for using the Notion API.

Usage

In app.module.ts:

import { NotionModule } from 'nest-notion';

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

In one of the modules you wish to use it in:

import { Module } from '@nestjs/common';
import { VegetableService } from './vegetable.service';
import { NotionModule } from 'nest-notion';

@Module({
  imports: [
    NotionModule,
  ],
  providers: [VegetableService],
  exports: [
    VegetableService,
  ],
})
export class VegetableModule {}

And in the service within the module:

import { Inject, Injectable } from '@nestjs/common';
import { NotionService } from 'nest-notion';

@Injectable()
export class VegetableService {
  constructor(
    @Inject(NotionService)
    private readonly notionService: NotionService
  ) { }

  listUsers() {
    return this.notionService.notion.users.list({ page_size: 10 });
  }
}