Skip to content

Commit

Permalink
update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
negrel committed Jul 13, 2024
1 parent 77eea05 commit d31f518
Showing 1 changed file with 42 additions and 6 deletions.
48 changes: 42 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,53 @@
## Getting started

### Building the project
Before sending Web Push message to a user agent, you need to create VAPID keys
(see [RFC 8292](https://www.rfc-editor.org/rfc/rfc8292)) to identify your server
(`Application`) to the `Push Service`:

```shell
make build
```
+-------+ +--------------+ +-------------+
| UA | | Push Service | | Application |
+-------+ +--------------+ +-------------+
| | |
| Setup | |
|<====================>| |
| Provide Subscription |
|-------------------------------------------->|
| | |
: : :
| | Push Message |
| Push Message |<---------------------|
|<---------------------| |
| | |
```

Run
[`generate-vapid-keys`](https://github.com/negrel/webpush/blob/master/cmd/generate-vapid-keys.ts)
script part of this repository to generate new keys:

```sh
# You can use any Web compatible runtime.
$ deno run https://raw.githubusercontent.com/negrel/webpush/master/cmd/generate-vapid-keys.ts
```

### Running the tests
Copy the output of the command and save it in `example/vapid.json`.
Now you can run example server.

```shell
make tests
```
$ cd example/
$ deno run -A ./main.ts
```

## Dependencies

This library tries its best at keeping the minimum number of dependencies. It
has no external dependencies except some runtime agnostic `@std/` packages
maintained by Deno team and [`http-ece`](https://github.com/negrel/http-ece),
which I maintain.

[`http-ece`](https://github.com/negrel/http-ece) also only depends on `@std/`
packages.

## Contributing

Expand Down

0 comments on commit d31f518

Please sign in to comment.