-
Notifications
You must be signed in to change notification settings - Fork 167
Pat/add notifs #436
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Pat/add notifs #436
Conversation
🟡 Heimdall Review Status
|
<Step title="Add the Webhook URL to your manifest"> | ||
Add the Webhook URL to your manifest file | ||
|
||
```json app/.well-known/farcaster.json highlight={16} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Didn't know you could do this (cc @soheimam @youssefea for awareness, this is a great way to call out specific sections of our code blocks)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes! really helps to steer the viewer
// Parse and verify the webhook event | ||
let data; | ||
try { | ||
data = await parseWebhookEvent(requestJson, verifyAppKeyWithNeynar); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we have "verifyAppKeyWithNeynar" in this codeblock... Thats going to be confusing for folks who don't know about neynar. might be okay for the short term, just calling it out. In the remainder of the codeblock we have a bunch of functions which aren't defined anywhere else which is OK since the codeblock is intended to give them a sense of what to do opposed to exactly what they're supposed to do
but want to flag
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
turned it into a filler function. we can have a "Validating webhook events" guide in the future
Save the `token` and `url` from the webhook event to a database for later use | ||
</Step> | ||
<Step title="Send notifications"> | ||
Send notifications by sending a `POST` request to the `url` associated with the user's `token` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe insted of "...the url
associated with the user's token
" say explicitly:
"...the url
sent with the token
in the miniapp_added_payload.json object sent when the user added your mini app"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO, I don't think that's much clearer. I can add an example event payload in step 4 then reference step 4 in this step.
Send notifications by sending a `POST` request to the `url` associated with the user's `token` | ||
|
||
```ts sendNotification.ts highlight={15-28} | ||
export async function sendFrameNotification({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it still called "sendFrameNotification" and not "sendMiniAppNotification"? I dont know so just checking if this is out of date
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can define it how we want this isn't a function exported from any particular package.
|
||
## Schema | ||
|
||
#### Send Notification Request Schema |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could we convert these tables into the description. constraint. structure that we've used in the manifest and context pages?
What changed? Why?
Notes to reviewers
How has it been tested?