Skip to content

Commit

Permalink
Merge branch 'master' into feature/#2-add-livecycle-hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
ComBarnea committed Sep 1, 2021
2 parents 544fd2f + 1d161df commit f9de15e
Showing 1 changed file with 80 additions and 2 deletions.
82 changes: 80 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,81 @@
# Notifire
<p align="center">
<a href="https://notifire.co">
<img width="200" src="https://notifire.co/img/logo.png">
</a>
</p>

Notification Management Framework
<h1 align="center">Notification management library</h1>

<div align="center">

The ultimate library for managing transactional notifications for node

</div>

## ✨ Features

- 🌈 Single API for all messaging providers
- 🌈 Easily manage notification and channels
- 📦 Easy to setup and integrate
- 🛡 Written in TypeScript with predictable static types.

## 📦 Install

```bash
npm install @notifire/lib
```

```bash
yarn add @notifire/lib
```

## 🔨 Usage

```ts
import { Notifire, ChannelTypeEnum } from '@notifire/lib';
import { SendgridProvider } from '@notifire/sendgrid-provider';

const notifire = new Notifire();

await notifire.registerProvider(
new SendgridProvider({
apiKey: process.env.SENDGRID_API_KEY
})
);

const passwordResetTemplate = await notifire.registerTemplate({
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>
{{#if organization}}
<img src="organization.logo" />
{{/if}}
`
},
]
});

await notifire.trigger('<REPLACE_WITH_EVENT_NAME>', {
$user_id: "<USER IDENTIFIER>",
$email: "test@email.com",
firstName: "John",
lastName: "Doe",
organization: {
logo: 'https://evilcorp.com/logo.png'
}
});
```

### TypeScript

`@notifire/lib` is written in TypeScript with complete definitions.

## 🔗 Links
- [Home page](https://notifire.co/)

0 comments on commit f9de15e

Please sign in to comment.