Skip to content

Commit 9ff30c6

Browse files
committed
updated for SEO
1 parent 0e545ec commit 9ff30c6

File tree

3 files changed

+69
-15
lines changed

3 files changed

+69
-15
lines changed

LICENSE

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
ISC License
2+
3+
Copyright (c) 2024 Cole Crouter
4+
5+
Permission to use, copy, modify, and/or distribute this software for any
6+
purpose with or without fee is hereby granted, provided that the above
7+
copyright notice and this permission notice appear in all copies.
8+
9+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15+
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

README.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,23 @@
22

33
> This project is not affiliated or based upon the original [web-push](https://github.com/web-push-libs/web-push) package or [web-push-lib](https://github.com/web-push-libs) organization.
44
5-
This package is aimed at being a lightweight replacement for [web-push](https://github.com/web-push-libs/web-push), as (at the time of writing) it relies on Node.js dependencies that are not available in the browser.
5+
Minimal, zero-dependency library for creating and sending Web Push (VAPID) notifications from environments without Node.js crypto shims — for example browsers, Cloudflare Workers, Deno, Bun, and other edge runtimes.
66

7-
## Installation
7+
Key features:
8+
9+
- Runs in browsers, Cloudflare Workers, Deno, Bun, and Node
10+
- Zero dependencies; ESM-first and browser-friendly
11+
- VAPID key generation, serialization/deserialization
12+
- Payload encryption with aes128gcm (aesgcm partially supported)
13+
- Helper to generate the correct Web Push request headers and send the POST
14+
15+
Install
816

917
```bash
1018
npm install web-push-browser
1119
```
1220

13-
## Example Usage
14-
15-
### Subscribing a User
21+
Quick example — how to send a push notification from an edge runtime or browser environment
1622

1723
```ts
1824
import { fromBase64Url } from 'web-push-browser';
@@ -38,7 +44,7 @@ try {
3844
}
3945
```
4046

41-
### Sending a Push Notification
47+
## Sending a Push Notification
4248

4349
```ts
4450
import { sendNotification, deserializeVapidKeys } from 'web-push-browser';
@@ -84,4 +90,4 @@ console.log(serializedKeys);
8490
This package only supports the basic functionality. If you need more advanced features, such as proxies, custom headers, etc. you can access the internal functions to create your own requests.
8591

8692
> [!NOTE]
87-
> `aesgcm` is not completely implemented in this package. Please use `aes128gcm` instead.
93+
> `aesgcm` is not completely implemented in this package. Please use `aes128gcm` instead.

package.json

Lines changed: 41 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
{
22
"name": "web-push-browser",
3-
"version": "1.3.1",
4-
"description": "Minimal library for sending notifications via the browser Push API",
3+
"version": "1.4.0",
4+
"description": "Zero-dependency Web Push (VAPID) for browsers, workers, Deno, Bun, and Node ESM — generate VAPID keys and send Push API notifications.",
55
"main": "build/index.js",
6+
"types": "build/index.d.ts",
7+
"exports": {
8+
".": {
9+
"types": "./build/index.d.ts",
10+
"import": "./build/index.js"
11+
}
12+
},
613
"devDependencies": {
714
"@types/jest": "^29.5.13",
815
"jest": "^29.7.0",
@@ -18,20 +25,46 @@
1825
"author": "Cole Crouter",
1926
"license": "ISC",
2027
"type": "module",
28+
"sideEffects": false,
2129
"keywords": [
30+
"web push",
2231
"push",
32+
"push api",
33+
"push notifications",
2334
"notifications",
24-
"web-push",
35+
"vapid",
36+
"vapid keys",
37+
"service worker",
38+
"service-worker",
39+
"subscription",
40+
"push subscription",
41+
"aes128gcm",
42+
"aesgcm",
43+
"encryption",
44+
"payload encryption",
2545
"browser",
26-
"esm",
46+
"workers",
47+
"cloudflare workers",
48+
"edge runtime",
49+
"deno",
50+
"bun",
2751
"node",
2852
"nodejs",
29-
"cloudflare",
30-
"deno",
31-
"bun"
53+
"esm",
54+
"typescript",
55+
"zero dependency"
3256
],
3357
"repository": {
3458
"type": "git",
3559
"url": "https://github.com/colecrouter/web-push-browser"
36-
}
60+
},
61+
"homepage": "https://github.com/colecrouter/web-push-browser#readme",
62+
"bugs": {
63+
"url": "https://github.com/colecrouter/web-push-browser/issues"
64+
},
65+
"files": [
66+
"build",
67+
"README.md",
68+
"LICENSE"
69+
]
3770
}

0 commit comments

Comments
 (0)