diff --git a/docs/web3inbox/backend-integration.mdx b/docs/web3inbox/backend-integration.mdx index cf5357073..3b4381227 100644 --- a/docs/web3inbox/backend-integration.mdx +++ b/docs/web3inbox/backend-integration.mdx @@ -26,6 +26,7 @@ To send a notification notification you can call the `/notify` endpoint. This en - `title` - The title of the notification. Max 64 characters. - `body` - The body of the notification containing more detail. Max 255 characters. - `url` (optional) - A URL attached to the notification that the user can navigate to. Max 255 characters. +- `data` (optional) - Arbitrary custom data that can be attached to the notification. Accessible by apps that display notifications. Max 255 characters. - `accounts` - A list of [CAIP-10](https://github.com/ChainAgnostic/CAIPs/blob/main/CAIPs/caip-10.md) account IDs for which to send the notification to. Max 500 accounts per request. Also see the [rate limits](#rate-limits) below. - `notification_id` (optional) - An idempotency key of arbitrary format used to dedup multiple requests. Max 255 characters. Multiple calls with the same `notification_id` will use the first call's `notification` content, but will send to any additional account IDs listed in `accounts`. @@ -37,6 +38,7 @@ type RequestBody = { title: string body: string url?: string | null + data?: string | null } accounts: string[] } diff --git a/docs/web3inbox/frontend-integration/api.mdx b/docs/web3inbox/frontend-integration/api.mdx index 90504d2d7..a842d0446 100644 --- a/docs/web3inbox/frontend-integration/api.mdx +++ b/docs/web3inbox/frontend-integration/api.mdx @@ -338,16 +338,24 @@ const { data: notifications, nextPage } = useNotifications(notificationsPerPage, - **notificationsPerPage:** Number representing how many notifications to get per fetch - **isInfiniteScroll:** Whether or not to keep already fetched notifications when getting next page -- **notifications:** Array of notifications, of type +- **notifications:** Array of notifications: ```ts -{ - title: string +type Notification = { + // Unique ID of this notification assigned by the Notify Server + id: string + // The timestamp when this notification was sent to the Notify Server sentAt: number + // The notification type ID of the notification + type: string + // The title of the notification + title: string + // The body of the notification body: string - id: string + // A call-to-action URL for when clicking on the notification url: string | null - type: string + // Arbitrary custom data set by the sender of the notification + data: string | null } ``` @@ -375,16 +383,24 @@ const { nextPage } = client.pageNotifications(notificationsPerPage, isInfiniteSc - **isInfiniteScroll:** Whether or not to keep already fetched notifications when getting next page - **onUpdate:**: A callback that will be called whenever notifications get updated - **nextPage:**: A function to be called to fetch the next page of notifications -- **notifications:** Array of notifications, of type +- **notifications:** Array of notifications: ```ts -{ - title: string +type Notification = { + // Unique ID of this notification assigned by the Notify Server + id: string + // The timestamp when this notification was sent to the Notify Server sentAt: number + // The notification type ID of the notification + type: string + // The title of the notification + title: string + // The body of the notification body: string - id: string + // A call-to-action URL for when clicking on the notification url: string | null - type: string + // Arbitrary custom data set by the sender of the notification + data: string | null } ```