# @notifire/nest

> A nestjs wrapper for notifire

Latest version **0.3.6-alpha.0** (published 2021-12-28) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @notifire/nest
pnpm add @notifire/nest
yarn add @notifire/nest
bun add @notifire/nest
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.3.6-alpha.0 |
| Published | 2021-12-28 |
| First published | 2021-12-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=10 |
| Dependencies | 2 |
| Unpacked size | 28 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 39964 |
| Maintainers | scopsy |

## Links

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

## Dependencies (2)

- [@nestjs/common](https://npm.io/package/@nestjs/common.md) ^8.2.0
- [@notifire/core](https://npm.io/package/@notifire/core.md) ^0.3.6-alpha.0

## Recent versions

- 0.3.6-alpha.0 (latest) — 2021-12-28
- 0.3.4 — 2021-12-24
- 0.3.3 — 2021-12-16
- 0.3.2-alpha.5 — 2021-12-15
- 0.3.2-alpha.4 — 2021-12-15
- 0.3.2-alpha.3 — 2021-12-15
- 0.3.2-alpha.0 — 2021-12-15

## README

# NestJS Module Wrapper

A NestJS module wrapper for [@notifire/core](https://github.com/notifirehq/notifire)

## Usage

Initializing module with templates and providers:
```javascript
    import { NotifireModule } from "@notifire/nest";

    @Module({
      imports: [
        NotifireModule.forRoot({
          providers: [
            new SendgridEmailProvider({
              apiKey: process.env.SENDGRID_API_KEY,
              from: 'sender@mail.com',
            }),
          ],
          templates: [
            {
              id: 'password-reset',
              messages: [
                {
                  subject: 'Your password reset request',
                  channel: ChannelTypeEnum.EMAIL,
                  template: `
                          Hi {{firstName}}!

                          To reset your password click <a href="{{resetLink}}">here.</a>
                          `,
                },
              ],
            },
          ],
        }),
      ],
    })
```

Using notifire's singleton service in other services and modules:

```javascript
import { Injectable, Inject } from '@nestjs/common';
import { NotifireService } from '@notifire/nest';

@Injectable()
export class UserService {
  constructor(private readonly notifire: NotifireService) {}

  async triggerEvent() {
    await this.notifire.trigger('password-reset', {
      $email: 'reciever@mail.com',
      $user_id: 'id'
    });
  }
}
```

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