fix: update the webhooks section with new implementation guide#661
fix: update the webhooks section with new implementation guide#661tamalchowdhury wants to merge 7 commits intomainfrom
Conversation
WalkthroughComprehensive updates to webhook documentation across four files: expanded core webhook concepts (terminology, flow, security, idempotency, retries), revised metadata/navigation, and new step-by-step integration guides for Next.js and Zapier with example code and testing/deployment guidance. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Deploying kinde-docs-preview with
|
| Latest commit: |
fed667e
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://4ac6b010.kinde-docs-preview.pages.dev |
| Branch Preview URL: | https://tamal-update-webhooks-sectio.kinde-docs-preview.pages.dev |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Fix all issues with AI agents
In `@src/content/docs/integrate/webhooks/webhooks-nextjs.mdx`:
- Around line 74-78: Add a brief prerequisite note telling users to set the
KINDE_ISSUER_URL environment variable before running the example so
decodeWebhook(token, process.env.KINDE_ISSUER_URL) can resolve the issuer;
specifically, add a "What you need" bullet or Step 1 that instructs them to
obtain their issuer URL from the Kinde dashboard (e.g.,
https://<tenant>.kinde.com or the exact issuer URL provided in the app settings)
and set it in their environment (export KINDE_ISSUER_URL="https://...") or in a
.env file so process.env.KINDE_ISSUER_URL is populated at runtime.
In `@src/content/docs/integrate/webhooks/zapier-event-hooks.mdx`:
- Around line 143-146: Update the Aside text that describes the JWT payload so
the field names match the actual payload and code: replace references to
given_name and family_name with first_name and last_name (email can remain
as-is), ensuring the Aside aligns with the webhook payload example and the Code
action that extracts these fields; look for the Aside block in
src/content/docs/integrate/webhooks/zapier-event-hooks.mdx and update its
wording accordingly.
- Around line 107-116: The decodeJWT function currently decodes the JWT payload
using plain base64 which fails for base64url; update decodeJWT to convert the
payload (parts[1]) from base64url to standard base64 by replacing '-' with '+'
and '_' with '/', then add '=' padding until length % 4 === 0 before calling
Buffer.from(..., 'base64') and JSON.parse; keep the existing checks for three
parts and throw on invalid token, and ensure the function name decodeJWT and
variable payload are the targets to modify.
🧹 Nitpick comments (1)
src/content/docs/integrate/webhooks/webhooks-nextjs.mdx (1)
100-116: Remove unreachablebreakstatements afterreturn.The
returnexits the handler, so thebreaks are dead code and add noise in a doc example.🧹 Example cleanup
switch (type) { case "user.updated": // handle user updated event // e.g. update database with data.user.email console.log(data); return NextResponse.json({ status: 200, statusText: "success" }); - break; case "user.created": // handle user created event // e.g. add user to database with data.user.email console.log(data); return NextResponse.json({ status: 200, statusText: "success" }); - break; default: // other events that we don't handle return NextResponse.json({ status: 200, statusText: "success" }); - break; }
Description (required)
Update the webhooks section with the new implementation guide.
Related issues & labels (optional)
Summary by CodeRabbit