Skip to content

Commit 7297e4f

Browse files
committed
Add sentence to UPGRADING.md
1 parent e80f293 commit 7297e4f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

UPGRADING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@ This version has some breaking changes:
77
- Import the package with `import Pushpad from 'pushpad';`.
88
- Create a Pushpad client instance with `const pushpad = new Pushpad({ authToken: "token", projectId: 123 });`.
99
- `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(data, options)` you should pass the `data` in *snake_case* (e.g. `target_url`), instead of using *camelCase* like in the previous version (e.g `targetUrl`). Since the payload is sent directly to the Pushpad REST API, this is more aligned with the API convention, with the OpenAPI specification and with other libraries.
1011
- 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.
1112
- 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)