Skip to content

Commit 60fd695

Browse files
committed
docs: update cron information
1 parent d875e26 commit 60fd695

File tree

2 files changed

+16
-12
lines changed

2 files changed

+16
-12
lines changed

.env.sample

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ DC_API_KEY=
88
# https://console.upstash.com/qstash
99
QSTASH_CURRENT_SIGNING_KEY=
1010
QSTASH_NEXT_SIGNING_KEY=
11+
# Qstash can be removed if using Vercel Cron
12+
# https://vercel.com/docs/cron-jobs/quickstart
13+
# DC cron endpoint: frame/send-notifications
14+
# /frame/[[...routes]]/route.tsx line 44 - 61 can be removed and verified with vercel cron env
1115

1216
NEXT_PUBLIC_SITE_URL=
1317
NEXT_PUBLIC_GOOGLE_ANALYTICS_ID=

app/frame/[[...routes]]/route.tsx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -49,25 +49,25 @@ app.hono.post("/send-notifications", async (c) => {
4949
}
5050
const body = await c.req.text();
5151
const currentDay = getCurrentDateUTC();
52+
53+
const isValid = await qstashReceiver
54+
.verify({
55+
body,
56+
signature,
57+
})
58+
.catch((e) => false);
59+
60+
if (!isValid) {
61+
return c.json({ error: "Invalid signature" }, 400);
62+
}
63+
5264
const notificationMessage = `
5365
Day ${currentDay} NFT is now mintable!.
5466
5567
${config.PROD_URL}/frame/dc
5668
5769
N/B: Unsubscribe from getting these notifications through the frame.
5870
`;
59-
60-
const isValid = await qstashReceiver
61-
.verify({
62-
body,
63-
signature,
64-
})
65-
.catch((e) => false);
66-
67-
if (!isValid) {
68-
return c.json({ error: "Invalid signature" }, 400);
69-
}
70-
7171
async function sendUserDCs() {
7272
// const userFids = [846887];
7373
const userFids = await kvStore.smembers(UNLOCK_REDIS_KEY);

0 commit comments

Comments
 (0)