# nest-notion

> Notion module for nest.js

Latest version **1.0.4** (published 2021-07-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install nest-notion
pnpm add nest-notion
yarn add nest-notion
bun add nest-notion
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2021-07-24 |
| First published | 2021-07-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 18.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Joseph Harrison-Lim |
| Maintainers | jharrilim |
| Keywords | nest, notion |

## Links

- npm: https://www.npmjs.com/package/nest-notion
- Repository: https://github.com/jharrilim/nest-notion
- Homepage: https://github.com/jharrilim/nest-notion#readme
- Issues: https://github.com/jharrilim/nest-notion/issues
- npm.io page: https://npm.io/package/nest-notion

## Dependencies (1)

- [@notionhq/client](https://npm.io/package/@notionhq/client.md) ^0.2.3

## Recent versions

- 1.0.4 (latest) — 2021-07-24
- 1.0.3 — 2021-07-19
- 1.0.2 — 2021-07-19
- 1.0.1 — 2021-07-18
- 1.0.0 — 2021-07-18

## README

# nest-notion

![npm](https://img.shields.io/npm/v/nest-notion?style=flat-square)
![npm](https://img.shields.io/npm/dt/nest-notion?style=flat-square)

Nest module for using the [Notion API](https://developers.notion.com/).

## Install

### NPM

```sh
npm i nest-notion
```

### Yarn

```sh
yarn add nest-notion
```

## Usage

In `app.module.ts`:

```ts
import { Module } from '@nestjs/common';
import { NotionModule } from 'nest-notion';
import { ConfigModule } from '@nestjs/config';
import { VegetableModule } from './vegetable/vegetable.module';

@Module({
  imports: [
    ConfigModule.forRoot({ // Need this to use process.env.NOTION_SECRET if it is in .env
      isGlobal: true,
    }),
    NotionModule.forRoot({
      auth: process.env.NOTION_SECRET,
    }),
    VegetableModule,
  ],
})
export class AppModule {}
```

An example module you wish to use it in:

```ts
import { Module } from '@nestjs/common';
import { VegetableService } from './vegetable.service';

@Module({
  providers: [VegetableService],
  exports: [
    VegetableService,
  ],
})
export class VegetableModule {}

```

In the service within the module:

```ts
import { Injectable } from '@nestjs/common';
import { NotionService } from 'nest-notion';

@Injectable()
export class VegetableService {
  constructor(
    private readonly notionService: NotionService
  ) { }

  listUsers() {
    return this.notionService.notion.users.list({ page_size: 10 });
  }
}

```

---
_Source: https://npm.io/package/nest-notion · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
