Skip to content

Commit e80f293

Browse files
committed
Add UPGRADING.md
1 parent 371145a commit e80f293

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

UPGRADING.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Upgrading to version 2.x
2+
3+
This version is a major rewrite of the library and adds support for the full REST API, including Notifications, Subscriptions, Projects and Senders.
4+
5+
This version has some breaking changes:
6+
7+
- Import the package with `import Pushpad from 'pushpad';`.
8+
- Create a Pushpad client instance with `const pushpad = new Pushpad({ authToken: "token", projectId: 123 });`.
9+
- `notification.deliverTo` and `notification.broadcast` were removed. Instead you should use `const result = await pushpad.notification.create(data, options);` (or the `send()` alias).
10+
- When you call `pushpad.notification.create()` with the `send_at` param, you should pass a ISO 8601 string. For example, you can use `new Date(Date.now() + 60_000).toISOString();` to send a notification after 60 seconds.
11+
- When you call `pushpad.notification.create()` there isn't a `project` param (like in the previous version), instead you can optionally use `pushpad.notification.create(data, { projectId: 456 });` if you want to override the global `projectId`.

0 commit comments

Comments
 (0)