File tree Expand file tree Collapse file tree
docs/mini-apps/core-concepts Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -35,17 +35,29 @@ Notification tokens are unique to each client app. This means a user can have se
3535</Panel >
3636## Implementation
3737<Steps >
38+ <Step title = " Install @farcaster/miniapp-node" >
39+ Install the ` @farcaster/miniapp-node ` package in your project:
40+ ``` bash
41+ npm install @farcaster/miniapp-node
42+ ```
43+ Get a free API key from [ neynar] ( https://dev.neynar.com/ ) and set ` NEYNAR_API_KEY ` in your environment variables.
44+ </Step >
45+
3846 <Step title = " Create a webhook server" >
3947 Create a webhook server to handle webhook events.
4048
4149 <Info >
50+ Use ` parseWebhookEvent ` with ` verifyAppKeyWithNeynar ` to verify the client signature and authenticate events signed by the app key.
51+
52+
4253 The ` data ` object returned by ` parseWebhookEvent ` contains three key fields:
4354 - ** ` fid ` ** : The user's FID
4455 - ** ` appFid ` ** : The client's FID (the Base app is 309857)
4556 - ** ` event ` ** : The event payload with type and notification details
4657
4758 Always use both ` fid ` and ` appFid ` together to identify a unique user-client combination.
4859 </Info >
60+
4961
5062 ``` ts app/api/webhook/route.ts expandable highlight={20-50}
5163
You can’t perform that action at this time.
0 commit comments