You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/mini-apps/core-concepts/notifications.mdx
+36-10Lines changed: 36 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,47 +5,70 @@ description: Regularly re-engage users by sending in-app notifications through t
5
5
6
6
## Overview
7
7
8
-
When a user enables notifications for your Mini App, the Base App generates a unique notification `token` and `url` which is sent to your server via webhook.
8
+
When a user enables notifications for your Mini App, the Base app generates a unique notification `token` and `url` which is sent to your server via webhook.
9
9
10
10
This `token` grants your app permission to send in-app notifications to that specific user.
11
11
12
12
To send a notification, make a `POST` request to the `url` with the user's notification `token` and your content.
13
13
14
14
You will receive webhook events when users enable or disable notifications for your app. When disabled, the notification token becomes invalid and should no longer be used.
Notification tokens are unique to each client app. This means a user can have separate notification preferences for your Mini App across different clients (e.g., Farcaster, the Base app). Removing your Mini App in one client does not affect its status in other clients.
21
+
</Info>
18
22
</Panel>
19
23
## Implementation
20
24
<Steps>
21
25
<Steptitle="Create a webhook server">
22
-
Create a webhook server to handle webhook events.
26
+
Create a webhook server to handle webhook events.
27
+
28
+
<Info>
29
+
The `data` object returned by `parseWebhookEvent` contains three key fields:
30
+
- **`fid`**: The user's FID
31
+
- **`appFid`**: The client's FID (the Base app is 309857)
32
+
- **`event`**: The event payload with type and notification details
33
+
34
+
Always use both `fid` and `appFid` together to identify a unique user-client combination.
@@ -263,7 +289,7 @@ Mini App events use the following object structure:
263
289
264
290
***`type`**: notification event type
265
291
***`notificationDetails.url`**: URL that the app should call to send a notification.
266
-
***`notificationDetails.token`**: A secret token generated by the Base App and shared with the Notification Server. A token is unique for each (Farcaster Client, Mini App, user Fid) tuple.
292
+
***`notificationDetails.token`**: A secret token generated by the Base app and shared with the Notification Server. A token is unique for each (Farcaster Client, Mini App, user Fid) tuple.
267
293
268
294
<Note>If users are not seeing the option to enable notifications when they call `addMiniApp()`, verify that your manifest file contains a valid `webhookUrl`.</Note>
0 commit comments