Skip to content

docs(webhooks): developer-experience polish#30

Merged
Yan Xue (yanxue06) merged 1 commit into
mainfrom
spectrum-webhook-dashboard-mention
May 15, 2026
Merged

docs(webhooks): developer-experience polish#30
Yan Xue (yanxue06) merged 1 commit into
mainfrom
spectrum-webhook-dashboard-mention

Conversation

@yanxue06
Copy link
Copy Markdown
Member

@yanxue06 Yan Xue (yanxue06) commented May 15, 2026

  • Add curl/JS/Python tabs to register/list/delete endpoints
  • Reframe delivery contract to lead with retry strength, not edge cases
  • Surface dashboard as a first-class peer of the API
  • Drop misleading TypeTooltip blocks showing methods that aren't in the payload
  • Small fixes: stale descriptions, redundant cards, dense single-row tables

View in Codesmith
Need help on this PR? Tag @codesmith with what you need.

  • Let Codesmith autofix CI failures and bot reviews

Summary by CodeRabbit

  • Documentation
    • Enhanced webhook documentation with clearer payload examples and improved event explanations.
    • Added multi-language code examples (curl, JavaScript, Python) for webhook management endpoints.
    • Restructured delivery and retry contract documentation for better clarity.
    • Expanded signature verification guide to include Go language support.

Review Change Stack

- Add curl/JS/Python tabs to register/list/delete endpoints
- Reframe delivery contract to lead with retry strength, not edge cases
- Surface dashboard as a first-class peer of the API
- Drop misleading TypeTooltip blocks showing methods that aren't in the payload
- Small fixes: stale descriptions, redundant cards, dense single-row tables
Copilot AI review requested due to automatic review settings May 15, 2026 20:47
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 15, 2026

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

Five webhook documentation files are updated to improve developer clarity and multi-language accessibility. The overview is restructured, event payload types are clarified using plain JSON literals instead of component references, management API examples are expanded to include JavaScript and Python alongside curl, and the delivery contract explanation is reformatted as a bullet-point list.

Changes

Webhook Documentation Improvements

Layer / File(s) Summary
Webhook overview and management guidance
webhooks/overview.mdx
The "Three ways to manage webhooks" section replaces a <Tip> wrapper with a dedicated subsection; the events listing removes the table and compresses the content to a single sentence mentioning the messages event payload shape; the "where to next" cards are updated to a new set with revised titles, icons, and body text.
Webhook event payload type documentation
docs-src/webhooks/events.mdx.vel
Top-level guidance clarifies that webhook payload types reflect JSON-serialized wire shapes rather than SDK interface signatures. The event: "messages" payload field types, Space section guidance, and Message section field descriptions all replace TypeTooltip-rendered type signatures with plain { id, platform } object literals.
Webhook management API examples
webhooks/managing-webhooks.mdx
The webhook registration, listing, and deletion endpoint sections each replace single-language curl snippets with CodeGroup blocks that include curl, JavaScript (fetch / DELETE), and Python (httpx) request examples, while preserving all response shapes and behavioral notes.
Webhook delivery contract and verification
webhooks/delivery.mdx, webhooks/verifying-signatures.mdx
The delivery page restructures the retry/acknowledgement contract as a "at a glance" bullet-point breakdown covering retry limits, status-code handling, timeout behavior, and at-least-once semantics. The verification page metadata is updated to list Node, Bun, Python, and Go.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • photon-hq/docs#24: Directly modifies the same set of webhook documentation pages to clarify content and improve organization.
  • photon-hq/docs#26: Updates the same docs-src/webhooks/events.mdx.vel Space/User type documentation sections (one removes TypeTooltip, the other manages type extraction).

Poem

🐰 TypeTooltips vanish like morning dew,
Plain JSON shapes now shine through and through!
Multi-tongue examples bloom in the light—
Webhook docs crystallize, oh what a sight! 🌟

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'docs(webhooks): developer-experience polish' accurately describes the primary intent of the changeset, which involves improving developer experience across webhook documentation through code examples, clearer explanations, and simplified presentation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch spectrum-webhook-dashboard-mention

Comment @coderabbitai help to get the list of available commands and usage tips.

@yanxue06 Yan Xue (yanxue06) merged commit 51e28c4 into main May 15, 2026
6 of 7 checks passed
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Documentation polish for the Spectrum webhooks guide: improves the developer experience by adding multi-language code samples for management endpoints, restructuring the delivery contract around its strengths, promoting the dashboard as a first-class management surface, and removing TypeTooltip references whose extracted SDK signatures (containing methods like .send()) didn't match the actual JSON-serialized webhook payloads.

Changes:

  • Add <CodeGroup> curl/JavaScript/Python tabs to register/list/delete webhook examples in managing-webhooks.mdx.
  • Replace the dense single-paragraph delivery contract with a 5-bullet "at a glance" summary and reorder for retry-strength framing.
  • Replace TypeTooltip references in events.mdx.vel with literal { id, platform } shapes that reflect the on-the-wire payload, and reframe the overview's three management surfaces (Tip → section, table → prose, Where-to-next cards trimmed).

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
webhooks/verifying-signatures.mdx Add Go to the languages enumerated in frontmatter description (matches existing Go snippet on line 154).
webhooks/overview.mdx Promote three-management-surfaces Tip into a section, collapse single-row events table into prose, and trim the "Where to next" Columns down to two cards.
webhooks/managing-webhooks.mdx Wrap each of the three webhook management endpoints in a <CodeGroup> with curl/JS/Python tabs.
webhooks/delivery.mdx Replace the one-paragraph contract with a 5-bullet summary leading with retry strength.
docs-src/webhooks/events.mdx.vel Drop TypeTooltip usages whose extracted SDK signatures included methods that don't survive JSON serialization; substitute literal { id, platform } types.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread webhooks/delivery.mdx
- **Strong retry behaviour.** Up to 4 attempts per event, with backoff on `5xx`, `408`, `429`, network errors, and worker-side timeouts. The vast majority of deliveries land on attempt 1; the retries are there for the occasional bad minute on your side.
- **Fast acknowledgement.** Any `2xx` ends it — the worker stops as soon as your server says ok.
- **Fast permanent failure.** Other `4xx` codes (`400`/`401`/`404`/etc.) are treated as fatal — we don't waste your retry budget when the request will never succeed.
- **Bounded budget.** 10-second per-attempt timeout, ~6.2 second total across all retries. If your server is still down after that, the event is logged and the worker moves on.
Comment thread webhooks/overview.mdx
Comment on lines +115 to +116
<Card title="Skim: How it works" icon="diagram-project" href="#how-it-works">
The mechanics first, in case you'd rather build a mental model before touching code.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants