Skip to content

chore: webhooks docs #7604

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

chore: webhooks docs #7604

wants to merge 1 commit into from

Conversation

arcoraven
Copy link
Contributor

@arcoraven arcoraven commented Jul 14, 2025


PR-Codex overview

This PR introduces a new Webhooks section in the application, providing a sidebar navigation item, a dedicated layout, and detailed documentation on webhooks, including their configuration, management, and security practices.

Detailed summary

  • Added sidebar configuration for Webhooks in sidebar.tsx.
  • Introduced SDKCard for Webhooks in page.tsx.
  • Renamed BAST_URL to BASE_URL in metadata.ts.
  • Created a new Layout component for Webhooks in layout.tsx.
  • Defined metadata for Webhooks in layout.tsx.
  • Added comprehensive documentation for webhooks in page.mdx, covering setup, management, event handling, and security.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

Summary by CodeRabbit

  • New Features

    • Introduced a new "Webhooks" section in the backend APIs grid, accessible from the main portal.
    • Added comprehensive documentation for thirdweb Webhooks, including setup, management, security, and troubleshooting guides.
    • Implemented a dedicated sidebar and layout for the Webhooks documentation page for easier navigation.
  • Documentation

    • Provided detailed instructions and code examples for implementing and verifying webhook integrations.
  • Bug Fixes

    • Corrected a typo in the base URL constant used for metadata generation.

Copy link

vercel bot commented Jul 14, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 14, 2025 6:56am
4 Skipped Deployments
Name Status Preview Comments Updated (UTC)
nebula ⬜️ Skipped (Inspect) Jul 14, 2025 6:56am
thirdweb_playground ⬜️ Skipped (Inspect) Jul 14, 2025 6:56am
thirdweb-www ⬜️ Skipped (Inspect) Jul 14, 2025 6:56am
wallet-ui ⬜️ Skipped (Inspect) Jul 14, 2025 6:56am

@vercel vercel bot temporarily deployed to Preview – thirdweb_playground July 14, 2025 06:48 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb-www July 14, 2025 06:48 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui July 14, 2025 06:48 Inactive
@vercel vercel bot temporarily deployed to Preview – nebula July 14, 2025 06:48 Inactive
Copy link

changeset-bot bot commented Jul 14, 2025

⚠️ No Changeset found

Latest commit: e8164cf

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

coderabbitai bot commented Jul 14, 2025

Walkthrough

A new "Webhooks" documentation section was added to the portal application, including a sidebar, layout, and a detailed MDX guide. The UI now features a "Webhooks" SDK card linking to this section. Supporting changes include sidebar configuration, metadata setup, and extending icon support for webhooks in the documentation image generator.

Changes

File(s) Change Summary
apps/portal/src/app/page.tsx Added "Webhooks" SDK card, imported and used WebhookIcon.
apps/portal/src/app/webhooks/layout.tsx, .../sidebar.tsx Introduced new layout and sidebar configuration for the webhooks section.
apps/portal/src/app/webhooks/page.mdx Added comprehensive documentation page for thirdweb Webhooks.
apps/portal/src/components/Document/metadata.ts Fixed base URL constant typo; added "webhooks" to icon type union for dynamic images.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant PortalApp
    participant Sidebar
    participant WebhooksLayout
    participant WebhooksDoc

    User->>PortalApp: Navigates to /webhooks
    PortalApp->>WebhooksLayout: Render layout with sidebar and metadata
    WebhooksLayout->>Sidebar: Load sidebar config (includes Webhooks)
    WebhooksLayout->>WebhooksDoc: Render documentation content
    WebhooksDoc-->>User: Display Webhooks guide and information
Loading
sequenceDiagram
    participant User
    participant PortalApp
    participant SDKCard

    User->>PortalApp: Views backend APIs grid
    PortalApp->>SDKCard: Render Webhooks card with icon and link to /webhooks
    SDKCard-->>User: User clicks "Webhooks" card
    User->>PortalApp: Navigates to /webhooks (see previous diagram)
Loading

Warning

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

Errors (1)
  • TEAM-0000: Entity not found: Issue - Could not find referenced Issue.
✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@arcoraven arcoraven marked this pull request as ready for review July 14, 2025 06:48
@github-actions github-actions bot added the Portal Involves changes to the Portal (docs) codebase. label Jul 14, 2025
@arcoraven arcoraven requested review from a team as code owners July 14, 2025 06:48
Copy link
Contributor Author

arcoraven commented Jul 14, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • merge-queue - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.


Webhooks are a way to receive real-time updates for onchain and offchain events.

An **event** is a real-time update or action that occured for your team or project.
Copy link
Contributor

Choose a reason for hiding this comment

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

There's a typo in this line: "occured" should be spelled "occurred" (with double 'r').

Suggested change
An **event** is a real-time update or action that occured for your team or project.
An **event** is a real-time update or action that occurred for your team or project.

Spotted by Diamond

Is this helpful? React 👍 or 👎 to let us know.

Copy link

codecov bot commented Jul 14, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 56.45%. Comparing base (8b6a953) to head (e8164cf).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7604   +/-   ##
=======================================
  Coverage   56.45%   56.45%           
=======================================
  Files         906      906           
  Lines       58115    58115           
  Branches     4226     4226           
=======================================
  Hits        32810    32810           
  Misses      25195    25195           
  Partials      110      110           
Flag Coverage Δ
packages 56.45% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 63.25 KB (0%) 1.3 s (0%) 586 ms (+30.85% 🔺) 1.9 s
thirdweb (cjs) 353.31 KB (0%) 7.1 s (0%) 2.9 s (-5.01% 🔽) 10 s
thirdweb (minimal + tree-shaking) 5.7 KB (0%) 114 ms (0%) 97 ms (+402.97% 🔺) 211 ms
thirdweb/chains (tree-shaking) 526 B (0%) 11 ms (0%) 19 ms (+86.87% 🔺) 29 ms
thirdweb/react (minimal + tree-shaking) 19.59 KB (0%) 392 ms (0%) 77 ms (+54.07% 🔺) 469 ms

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (4)
apps/portal/src/components/Document/metadata.ts (1)

25-27: Non-alphabetical union literals make scanning harder

New literals were appended to the end of the icon union. Keeping the list sorted alphabetically avoids future merge-conflicts and improves readability.

apps/portal/src/app/webhooks/layout.tsx (1)

10-12: Missing flex class means the column styles are ignored

flex-col without flex is a no-op; the header renders as a normal block.

-        <div className="flex-col items-center gap-1">
+        <div className="flex flex-col items-center gap-1">
apps/portal/src/app/webhooks/page.mdx (2)

15-15: Spelling – “occurred” not “occured”


1-3: Unused imports bloat the MDX bundle

Details, DocImage, FeatureCard, OpenSourceCard, Callout, ArrowLeftRightIcon, UserLockIcon, UsersIcon, WalletIcon are imported but never used. Please remove.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 72f75ea and e8164cf.

📒 Files selected for processing (5)
  • apps/portal/src/app/page.tsx (2 hunks)
  • apps/portal/src/app/webhooks/layout.tsx (1 hunks)
  • apps/portal/src/app/webhooks/page.mdx (1 hunks)
  • apps/portal/src/app/webhooks/sidebar.tsx (1 hunks)
  • apps/portal/src/components/Document/metadata.ts (3 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx}

Instructions used from:

Sources:
📄 CodeRabbit Inference Engine

  • CLAUDE.md
🧠 Learnings (6)
📓 Common learnings
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T10:25:29.488Z
Learning: Surface breaking changes prominently in PR descriptions
Learnt from: AmineAfia
PR: thirdweb-dev/js#7173
File: apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/components/WebhooksTable.tsx:59-73
Timestamp: 2025-05-27T21:57:09.248Z
Learning: In the webhooks functionality, form validation prevents users from reaching test webhook functionality without entering a valid URL, ensuring data integrity before testing operations.
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T10:25:29.489Z
Learning: Applies to apps/{dashboard,playground-web}/**/*.{tsx,ts} : Client Components: Handle interactive UI with React hooks (`useState`, `useEffect`, React Query, wallet hooks)
apps/portal/src/app/page.tsx (12)
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-06-30T10:26:04.389Z
Learning: Applies to dashboard/**/components/**/*.{ts,tsx} : Icons come from `lucide-react` or the project-specific `…/icons` exports – never embed raw SVG.
Learnt from: saminacodes
PR: thirdweb-dev/js#7543
File: apps/portal/src/app/pay/page.mdx:4-4
Timestamp: 2025-07-07T21:21:47.488Z
Learning: In the thirdweb-dev/js repository, lucide-react icons must be imported with the "Icon" suffix (e.g., ExternalLinkIcon, RocketIcon) as required by the new linting rule, contrary to the typical lucide-react convention of importing without the suffix.
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T10:25:29.488Z
Learning: Applies to apps/{dashboard,playground-web}/**/*.{tsx,ts} : Import UI primitives from `@/components/ui/*` (Button, Input, Select, Tabs, Card, Sidebar, Badge, Separator) in dashboard and playground apps
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T10:25:29.488Z
Learning: Applies to apps/{dashboard,playground-web}/**/*.{tsx,ts} : Use design system tokens (e.g., `bg-card`, `border-border`, `text-muted-foreground`)
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-06-30T10:26:04.389Z
Learning: Applies to dashboard/**/components/*.client.tsx : Anything that consumes hooks from `@tanstack/react-query` or thirdweb SDKs.
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T10:25:29.489Z
Learning: Applies to apps/{dashboard,playground-web}/**/*.{tsx,ts} : Client Components: Handle interactive UI with React hooks (`useState`, `useEffect`, React Query, wallet hooks)
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-06-30T10:26:04.389Z
Learning: Applies to dashboard/**/components/*.client.tsx : Interactive UI that relies on hooks (`useState`, `useEffect`, React Query, wallet hooks).
Learnt from: arcoraven
PR: thirdweb-dev/js#7505
File: apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/analytics/components/WebhookAnalyticsCharts.tsx:186-204
Timestamp: 2025-07-10T10:18:33.238Z
Learning: The ThirdwebBarChart component in apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/analytics/components/WebhookAnalyticsCharts.tsx does not accept standard accessibility props like `aria-label` and `role` in its TypeScript interface, causing compilation errors when added.
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T10:25:29.488Z
Learning: Applies to apps/{dashboard,playground-web}/**/*.{tsx,ts} : Server Components (Node edge): Start files with `import "server-only";`
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-06-30T10:26:04.389Z
Learning: Applies to dashboard/**/components/**/*.{ts,tsx} : Reuse core UI primitives; avoid re-implementing buttons, cards, modals.
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-06-30T10:26:04.389Z
Learning: Applies to dashboard/**/components/**/*.{ts,tsx} : Always import from the central UI library under `@/components/ui/*` – e.g. `import { Button } from "@/components/ui/button"`.
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-06-30T10:26:04.389Z
Learning: Applies to dashboard/**/components/**/*.{ts,tsx} : Prefer composable primitives over custom markup: `Button`, `Input`, `Select`, `Tabs`, `Card`, `Sidebar`, `Separator`, `Badge`.
apps/portal/src/components/Document/metadata.ts (3)
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-06-30T10:26:04.389Z
Learning: Applies to dashboard/**/components/**/*.{ts,tsx} : Icons come from `lucide-react` or the project-specific `…/icons` exports – never embed raw SVG.
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T10:25:29.488Z
Learning: Applies to apps/{dashboard,playground-web}/**/*.{tsx,ts} : Use design system tokens (e.g., `bg-card`, `border-border`, `text-muted-foreground`)
Learnt from: saminacodes
PR: thirdweb-dev/js#7543
File: apps/portal/src/app/pay/page.mdx:4-4
Timestamp: 2025-07-07T21:21:47.488Z
Learning: In the thirdweb-dev/js repository, lucide-react icons must be imported with the "Icon" suffix (e.g., ExternalLinkIcon, RocketIcon) as required by the new linting rule, contrary to the typical lucide-react convention of importing without the suffix.
apps/portal/src/app/webhooks/sidebar.tsx (13)
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-06-30T10:26:04.389Z
Learning: Applies to dashboard/**/layout.tsx : Layouts should reuse `SidebarLayout` / `FullWidthSidebarLayout` (`@/components/blocks/SidebarLayout`).
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T10:25:29.488Z
Learning: Applies to apps/{dashboard,playground-web}/**/*.{tsx,ts} : Use `NavLink` for internal navigation with automatic active states in dashboard and playground apps
Learnt from: arcoraven
PR: thirdweb-dev/js#7505
File: apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/analytics/components/WebhookAnalyticsCharts.tsx:186-204
Timestamp: 2025-07-10T10:18:33.238Z
Learning: The ThirdwebBarChart component in apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/analytics/components/WebhookAnalyticsCharts.tsx does not accept standard accessibility props like `aria-label` and `role` in its TypeScript interface, causing compilation errors when added.
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T10:25:29.488Z
Learning: Applies to apps/{dashboard,playground-web}/**/*.{tsx,ts} : Import UI primitives from `@/components/ui/*` (Button, Input, Select, Tabs, Card, Sidebar, Badge, Separator) in dashboard and playground apps
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T10:25:29.489Z
Learning: Applies to apps/{dashboard,playground-web}/**/*.{tsx,ts} : Client Components: Handle interactive UI with React hooks (`useState`, `useEffect`, React Query, wallet hooks)
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-06-30T10:26:04.389Z
Learning: Applies to dashboard/**/components/*.client.tsx : Anything that consumes hooks from `@tanstack/react-query` or thirdweb SDKs.
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-06-30T10:26:04.389Z
Learning: Applies to dashboard/**/components/*.client.tsx : Interactive UI that relies on hooks (`useState`, `useEffect`, React Query, wallet hooks).
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T10:25:29.488Z
Learning: Applies to apps/{dashboard,playground-web}/**/*.{tsx,ts} : Expose `className` prop on root element for overrides in UI components
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-06-30T10:26:04.389Z
Learning: Applies to dashboard/**/hooks/**/*.{ts,tsx} : Prefer API routes or server actions to keep tokens secret; the browser only sees relative paths.
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T10:25:29.489Z
Learning: Applies to apps/{dashboard,playground-web}/**/*.{tsx,ts} : Server Components: Implement redirect logic with `redirect()` from `next/navigation`
Learnt from: saminacodes
PR: thirdweb-dev/js#7543
File: apps/portal/src/app/pay/page.mdx:4-4
Timestamp: 2025-07-07T21:21:47.488Z
Learning: In the thirdweb-dev/js repository, lucide-react icons must be imported with the "Icon" suffix (e.g., ExternalLinkIcon, RocketIcon) as required by the new linting rule, contrary to the typical lucide-react convention of importing without the suffix.
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-06-30T10:26:04.389Z
Learning: Applies to dashboard/**/components/**/*.{ts,tsx} : Icons come from `lucide-react` or the project-specific `…/icons` exports – never embed raw SVG.
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-06-30T10:26:04.389Z
Learning: Applies to dashboard/**/layout.tsx : Building layout shells (`layout.tsx`) and top-level pages that mainly assemble data.
apps/portal/src/app/webhooks/layout.tsx (13)
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-06-30T10:26:04.389Z
Learning: Applies to dashboard/**/layout.tsx : Building layout shells (`layout.tsx`) and top-level pages that mainly assemble data.
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-06-30T10:26:04.389Z
Learning: Applies to dashboard/**/layout.tsx : Layouts should reuse `SidebarLayout` / `FullWidthSidebarLayout` (`@/components/blocks/SidebarLayout`).
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T10:25:29.489Z
Learning: Applies to apps/{dashboard,playground-web}/**/*.{tsx,ts} : Client Components: Handle interactive UI with React hooks (`useState`, `useEffect`, React Query, wallet hooks)
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-06-30T10:26:04.389Z
Learning: Applies to dashboard/**/components/*.client.tsx : Interactive UI that relies on hooks (`useState`, `useEffect`, React Query, wallet hooks).
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-06-30T10:26:04.389Z
Learning: Applies to dashboard/**/components/*.client.tsx : Anything that consumes hooks from `@tanstack/react-query` or thirdweb SDKs.
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T10:25:29.488Z
Learning: Applies to apps/{dashboard,playground-web}/**/*.{tsx,ts} : Import UI primitives from `@/components/ui/*` (Button, Input, Select, Tabs, Card, Sidebar, Badge, Separator) in dashboard and playground apps
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-06-30T10:26:04.389Z
Learning: Applies to dashboard/**/components/**/*.{ts,tsx} : For notices & skeletons rely on `AnnouncementBanner`, `GenericLoadingPage`, `EmptyStateCard`.
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T10:25:29.489Z
Learning: Applies to apps/{dashboard,playground-web}/**/*.{tsx,ts} : Server Components: Perform heavy data fetching
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T10:25:29.488Z
Learning: Applies to apps/{dashboard,playground-web}/**/*.{tsx,ts} : Use `NavLink` for internal navigation with automatic active states in dashboard and playground apps
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T10:25:29.489Z
Learning: Applies to apps/{dashboard,playground-web}/**/*.{tsx,ts} : Server Components: Implement redirect logic with `redirect()` from `next/navigation`
Learnt from: MananTank
PR: thirdweb-dev/js#7152
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/tokens/shared-page.tsx:41-48
Timestamp: 2025-05-26T16:28:50.772Z
Learning: The `projectMeta` prop is not required for the server-rendered `ContractTokensPage` component in the tokens shared page, unlike some other shared pages where it's needed for consistency.
Learnt from: arcoraven
PR: thirdweb-dev/js#7505
File: apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/analytics/components/WebhookAnalyticsCharts.tsx:186-204
Timestamp: 2025-07-10T10:18:33.238Z
Learning: The ThirdwebBarChart component in apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/webhooks/analytics/components/WebhookAnalyticsCharts.tsx does not accept standard accessibility props like `aria-label` and `role` in its TypeScript interface, causing compilation errors when added.
Learnt from: MananTank
PR: thirdweb-dev/js#7177
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/erc20.tsx:15-17
Timestamp: 2025-05-27T19:54:55.885Z
Learning: The `fetchDashboardContractMetadata` function from "@3rdweb-sdk/react/hooks/useDashboardContractMetadata" has internal error handlers for all promises and cannot throw errors, so external error handling is not needed when calling this function.
apps/portal/src/app/webhooks/page.mdx (7)
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T10:25:29.488Z
Learning: Applies to packages/thirdweb/src/exports/**/*.{ts,tsx} : Every public symbol must have comprehensive TSDoc with at least one `@example` block that compiles and custom annotation tags (`@beta`, `@internal`, `@experimental`)
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-06-30T10:26:04.389Z
Learning: Applies to dashboard/**/components/*.client.tsx : Anything that consumes hooks from `@tanstack/react-query` or thirdweb SDKs.
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T10:25:29.489Z
Learning: Applies to src/@/analytics/report.ts : Analytics Events: Event name should be human-readable `<subject> <verb>` (e.g. "contract deployed")
Learnt from: MananTank
PR: thirdweb-dev/js#7177
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/public-pages/erc20/erc20.tsx:15-17
Timestamp: 2025-05-27T19:54:55.885Z
Learning: The `fetchDashboardContractMetadata` function from "@3rdweb-sdk/react/hooks/useDashboardContractMetadata" has internal error handlers for all promises and cannot throw errors, so external error handling is not needed when calling this function.
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-06-30T10:26:04.389Z
Learning: Applies to dashboard/**/hooks/**/*.{ts,tsx} : Configure `staleTime` / `cacheTime` according to freshness requirements.
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-06-30T10:26:04.389Z
Learning: Applies to dashboard/**/components/*.client.tsx : Interactive UI that relies on hooks (`useState`, `useEffect`, React Query, wallet hooks).
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-06-30T10:26:04.389Z
Learning: Applies to dashboard/**/hooks/**/*.{ts,tsx} : Prefer API routes or server actions to keep tokens secret; the browser only sees relative paths.
🧬 Code Graph Analysis (2)
apps/portal/src/app/page.tsx (1)
apps/portal/src/components/Document/SDKCard.tsx (1)
  • SDKCard (4-27)
apps/portal/src/app/webhooks/layout.tsx (2)
apps/portal/src/app/webhooks/sidebar.tsx (1)
  • sidebar (4-13)
apps/portal/src/components/Document/metadata.ts (1)
  • createMetadata (31-64)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Size
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (5)
apps/portal/src/app/webhooks/sidebar.tsx (1)

1-1: Import follows the “Icon”-suffix rule – ✅

apps/portal/src/app/page.tsx (2)

150-155: Internal link should use absolute path helper

All internal routes elsewhere use href={route("/webhooks")} (wrapper around next/link that handles basePath). Using the raw string risks breaking in multi-deploy setups.

-        <SDKCard
-          href="/webhooks"
+        <SDKCard
+          href={route("/webhooks")}

1-1: Import order not enforced here – looks fine

apps/portal/src/app/webhooks/layout.tsx (1)

20-27: Consider adding import "server-only";

This file is rendered on the server only and pulls portal-only utilities. Adding the directive avoids accidental client bundling.

apps/portal/src/app/webhooks/page.mdx (1)

122-147: Potential runtime errors in signature-verification snippet

  1. actualSignature & timestamp are strings | string[] | undefined – call String() or assert type before use.
  2. Raw body must be the exact bytes received; JSON.stringify or body parsers will fail verification. Add a comment to emphasise.

Comment on lines 44 to 46
height: 630,
url: `${BAST_URL}/api/og?icon=${obj.image.icon}&title=${obj.image.title}`,
url: `${BASE_URL}/api/og?icon=${obj.image.icon}&title=${obj.image.title}`,
width: 1200,
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Use URLSearchParams to escape user-supplied values

title comes straight from obj.image.title; if it ever contains &, ?, or #, the generated URL will break. Safer to build the query string with URLSearchParams.

- url: `${BASE_URL}/api/og?icon=${obj.image.icon}&title=${obj.image.title}`,
+ url: `${BASE_URL}/api/og?` +
+   new URLSearchParams({
+     icon: obj.image.icon,
+     title: obj.image.title,
+   }).toString(),
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
height: 630,
url: `${BAST_URL}/api/og?icon=${obj.image.icon}&title=${obj.image.title}`,
url: `${BASE_URL}/api/og?icon=${obj.image.icon}&title=${obj.image.title}`,
width: 1200,
height: 630,
url: `${BASE_URL}/api/og?` +
new URLSearchParams({
icon: obj.image.icon,
title: obj.image.title,
}).toString(),
width: 1200,
🤖 Prompt for AI Agents
In apps/portal/src/components/Document/metadata.ts around lines 44 to 46, the
URL query string is constructed by directly embedding user-supplied values,
which can break the URL if special characters like &, ?, or # are present. To
fix this, replace the string interpolation with URLSearchParams to properly
encode the query parameters. Create a new URLSearchParams instance, append the
icon and title values from obj.image, and use its toString() method to build the
query string safely.

Comment on lines +8 to +10
icon: <WebhookIcon />,
name: "Overview",
},
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Pass the icon component, not the rendered element

DocLayout sidebars in this repo expect a React component (e.g. WebhookIcon) so they can uniformly size & theme it. Passing <WebhookIcon /> produces a pre-rendered node and breaks those controls.

-      icon: <WebhookIcon />,
+      icon: WebhookIcon,
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
icon: <WebhookIcon />,
name: "Overview",
},
icon: WebhookIcon,
name: "Overview",
},
🤖 Prompt for AI Agents
In apps/portal/src/app/webhooks/sidebar.tsx around lines 8 to 10, the icon
property is assigned a rendered React element <WebhookIcon /> instead of the
component itself. Replace the icon value to pass the WebhookIcon component
directly without JSX syntax, i.e., use WebhookIcon instead of <WebhookIcon /> so
that DocLayout sidebars can properly size and theme the icon.

Comment on lines +154 to +159
const MAX_AGE_SECONDS = 10 * 60 * 1000; // 10 minutes
const timestamp = req.headers["x-webhook-timestamp"];
if (Date.now() / 1000 - timestamp > MAX_AGE_SECONDS) {
throw new Error("Webhook expired");
}
```
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Unit mismatch – constant is milliseconds but compared against seconds

MAX_AGE_SECONDS multiplies by 1000 but is compared to values in seconds.

-const MAX_AGE_SECONDS = 10 * 60 * 1000; // 10 minutes
+const MAX_AGE_SECONDS = 10 * 60; // 10 minutes in seconds
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const MAX_AGE_SECONDS = 10 * 60 * 1000; // 10 minutes
const timestamp = req.headers["x-webhook-timestamp"];
if (Date.now() / 1000 - timestamp > MAX_AGE_SECONDS) {
throw new Error("Webhook expired");
}
```
const MAX_AGE_SECONDS = 10 * 60; // 10 minutes in seconds
const timestamp = req.headers["x-webhook-timestamp"];
if (Date.now() / 1000 - timestamp > MAX_AGE_SECONDS) {
throw new Error("Webhook expired");
}
🤖 Prompt for AI Agents
In apps/portal/src/app/webhooks/page.mdx around lines 154 to 159, the constant
MAX_AGE_SECONDS is incorrectly calculated in milliseconds (multiplied by 1000)
but compared against a timestamp difference in seconds. To fix this, either
rename the constant to reflect milliseconds and convert the timestamp difference
to milliseconds before comparison, or keep the constant in seconds by removing
the multiplication by 1000 so that both values are in the same unit for accurate
comparison.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Portal Involves changes to the Portal (docs) codebase.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants