-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into feature/#2-add-livecycle-hooks
- Loading branch information
Showing
1 changed file
with
80 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/) |