Skip to content

Commit

Permalink
chore: improve docs
Browse files Browse the repository at this point in the history
  • Loading branch information
maxholman committed Jun 11, 2024
1 parent 6db55e6 commit 915d6a5
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# @block65/webcrypto-web-push

Send notifications using Web Push Protocol and Web Crypto APIs (compatible with
both Node and Cloudflare Workers)
Send notifications using Web Push Protocol and Web Crypto APIs (works with
NodeJS, Cloudflare Workers, Bun and Deno)

## Installation

Expand All @@ -22,9 +22,9 @@ pnpm add @block65/webcrypto-web-push
### Typescript

> **Note**
> This is an ESM package, if you are using Typescript, you will need
to set `moduleResolution` to `node16`, `nodenext` or `bundler` in order to
resolve the package exports.
> This is an ESM package. If you are using Typescript, you will need
> to set `moduleResolution` to `node16`, `nodenext` or `bundler` in order to
> resolve the package exports.
## Usage

Expand All @@ -36,7 +36,6 @@ import {
buildPushPayload,
} from '@block65/webcrypto-web-push';


// `env` could be `process.env` or `import.meta.env` depending
// on your platform or build tooling
const vapid: VapidKeys = {
Expand Down Expand Up @@ -67,6 +66,8 @@ const payload = await buildPushPayload(message, subscription, vapid);

// send the payload to the subscription endpoint using your favourite HTTP client
const res = await fetch(subscription.endpoint, payload);

console.log(res.status); // 201
```

## License
Expand Down

0 comments on commit 915d6a5

Please sign in to comment.