-
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.
chore(providers): Update readme to describe installation and usage (#…
…5573) * fix(providers): Readme * fix: add novu logo and cloud cta * fix: add badges
- Loading branch information
Showing
1 changed file
with
36 additions
and
7 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,15 +1,44 @@ | ||
# Novu Apns Provider | ||
<div align="center"> | ||
<a href="https://novu.co?utm_source=github" target="_blank"> | ||
<picture> | ||
<source media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/2233092/213641039-220ac15f-f367-4d13-9eaf-56e79433b8c1.png"> | ||
<img alt="Novu Logo" src="https://user-images.githubusercontent.com/2233092/213641043-3bbb3f21-3c53-4e67-afe5-755aeb222159.png" width="280"/> | ||
</picture> | ||
</a> | ||
</div> | ||
|
||
A Apns push provider library for [@novu/node](https://github.com/novuhq/novu) | ||
# Novu Providers | ||
|
||
[![Version](https://img.shields.io/npm/v/@novu/providers.svg)](https://www.npmjs.org/package/@novu/providers) | ||
[![Downloads](https://img.shields.io/npm/dm/@novu/providers.svg)](https://www.npmjs.com/package/@novu/providers) | ||
|
||
A collection of stateless notification delivery providers, abstracting the underlying delivery provider implementation details. Independently usable, and additionally consumed by the [Novu Platform](https://novu.co/). | ||
|
||
## Installation | ||
|
||
```bash | ||
npm install @novu/providers | ||
``` | ||
|
||
## Usage | ||
|
||
The `@novu/providers` package contains a set of providers that can be used to send notifications to various channels. | ||
|
||
The following example shows how to use the TwilioSmsProvider to send a message to a phone number. | ||
|
||
```javascript | ||
import { APNSPushProvider } from '@novu/apns'; | ||
import { TwilioSmsProvider } from '@novu/providers'; | ||
|
||
const provider = new APNSPushProvider({ | ||
key: "path/to/APNsAuthKey_XXXXXXXXXX.p8", | ||
keyId: "key-id", | ||
teamId: "developer-team-id" | ||
const provider = new TwilioSmsProvider({ | ||
accountSid: process.env.TWILIO_ACCOUNT_SID, | ||
authToken: process.env.TWILIO_AUTH_TOKEN, | ||
from: process.env.TWILIO_FROM_NUMBER, // a valid twilio phone number | ||
}); | ||
|
||
await provider.sendMessage({ | ||
to: '0123456789', | ||
content: 'Message to send', | ||
}); | ||
``` | ||
|
||
For all supported providers, visit the [Novu Providers package](https://github.com/novuhq/novu/tree/next/packages/providers/src/lib). |