Skip to content

Conversation

@joaquim-verges
Copy link
Member

@joaquim-verges joaquim-verges commented Oct 2, 2025


PR-Codex overview

This PR focuses on updating the payment and transaction policies within the thirdweb platform, enhancing the API documentation, and refining the user interface for better clarity on payment handling and sponsorship policies.

Detailed summary

  • Updated name for the facilitator API in payments/sidebar.tsx.
  • Added Sponsorship Policies section in transactions/sidebar.tsx.
  • Changed payment link in settings/SponsorshipPolicies/index.tsx.
  • Enhanced documentation in payments/x402/page.mdx about payment handling and middleware.
  • Updated facilitator description in payments/x402/facilitator/page.mdx.
  • Revised payment request flow in payments/x402/client/page.mdx.
  • Introduced Gas Sponsorship Policies in transactions/policies/page.mdx.

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

Summary by CodeRabbit

  • Style

    • Renamed sidebar link from “Facilitator API” to “Facilitator”.
  • Documentation

    • Simplified x402 client flow to a single fetch-based call (/v1/payments/x402/fetch); updated examples and switched auth to wallet token.
    • Renamed “Facilitator API” docs to “Facilitator” and added “Chain and token support” (ERC-2612/3009).
    • Added client/server guidance for x402 middleware and facilitator settlement.
    • Added new Gas Sponsorship Policies doc and linked it from the Transactions guides.

@vercel
Copy link

vercel bot commented Oct 2, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
docs-v2 Ready Ready Preview Comment Oct 2, 2025 9:57pm
thirdweb-www Ready Ready Preview Comment Oct 2, 2025 9:57pm
3 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
nebula Skipped Skipped Oct 2, 2025 9:57pm
thirdweb_playground Skipped Skipped Oct 2, 2025 9:57pm
wallet-ui Skipped Skipped Oct 2, 2025 9:57pm

@vercel vercel bot temporarily deployed to Preview – nebula October 2, 2025 21:29 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui October 2, 2025 21:29 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb-www October 2, 2025 21:29 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground October 2, 2025 21:29 Inactive
@changeset-bot
Copy link

changeset-bot bot commented Oct 2, 2025

⚠️ No Changeset found

Latest commit: 8f32dee

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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 2, 2025

Walkthrough

Replace the x402 prepare/sign flow with a single POST fetch-based flow, update related documentation and facilitator content, add sponsorship-policies docs and sidebar link, and rename a portal sidebar entry from "Facilitator API" to "Facilitator".

Changes

Cohort / File(s) Summary
Navigation label update
apps/portal/src/app/payments/sidebar.tsx
Rename sidebar link label under x402 from "Facilitator API" to "Facilitator".
Client x402 docs (fetch flow)
apps/portal/src/app/payments/x402/client/page.mdx
Replace prepare/sign multi-step flow with single POST /v1/payments/x402/fetch?url={target}&from={addr} using user-wallet-token; body is passthrough to target. Update curl example and API reference endpoint to /v1/payments/x402/fetch.
Facilitator docs content update
apps/portal/src/app/payments/x402/facilitator/page.mdx
Retitle page to "Facilitator" and add a "Chain and token support" section describing cross-chain facilitator requirements and ERC-2612 / ERC-3009 token considerations.
x402 overview content
apps/portal/src/app/payments/x402/page.mdx
Add client-side paragraph about fetching x402 endpoints via thirdweb API with authenticated wallet and server-side paragraphs about middleware patterns and facilitator on-chain settlement.
Sponsorship policies page
apps/portal/src/app/transactions/policies/page.mdx
Add new documentation page describing Gas Sponsorship Policies, Server Verifier integration, request/response shapes, and example HTTP flows for backend verification.
Transactions sidebar update
apps/portal/src/app/transactions/sidebar.tsx
Add "Sponsorship Policies" link under Guides with href: /transactions/policies.
Account abstraction doc link fix
apps/dashboard/src/app/.../SponsorshipPolicies/index.tsx
Update Server verifier documentation link href to /transactions/policies#server-verifier.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Client as Client App
  participant API as Thirdweb API (/v1/payments/x402/fetch)
  participant Target as Target API (x402-protected)
  participant Wallet as Authenticated Wallet
  participant Facilitator as Facilitator

  Client->>API: POST /v1/payments/x402/fetch?url={target}&from={wallet}\nAuthorization: Bearer {user-wallet-token}\n(body passthrough)
  API->>Target: Forward request to {target} (passthrough body)
  Target-->>API: 402 Payment Required (challenge)
  API->>Facilitator: Request payment/settlement for challenge
  Facilitator->>Wallet: Use authenticated/server wallet to authorize/submit on-chain payment
  Wallet-->>Facilitator: Payment confirmation
  Facilitator-->>API: Settlement result
  API->>Target: Retry proxied request after payment
  Target-->>API: 2xx Response
  API-->>Client: Return proxied response
  alt Payment failure
    API-->>Client: Error (payment/authorization failed)
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The description still contains only the commented-out template and a PR-Codex overview without filling in the required title format, reviewer notes, or testing instructions. Replace the commented template with actual sections: provide a properly formatted PR title, fill in the “Notes for the reviewer,” and include clear “How to test” steps.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run `@coderabbitai generate docstrings` to improve docstring coverage.
✅ Passed checks (1 passed)
Check name Status Explanation
Title Check ✅ Passed The title concisely summarizes the primary change, focusing on simplifying the x402 documentation, and it’s clear and specific.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch _Docs_Simplify_x402_documentation_and_rename_Facilitator_API_to_Facilitator_

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 716123e and 8f32dee.

📒 Files selected for processing (7)
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/account-abstraction/settings/SponsorshipPolicies/index.tsx (1 hunks)
  • apps/portal/src/app/payments/sidebar.tsx (1 hunks)
  • apps/portal/src/app/payments/x402/client/page.mdx (1 hunks)
  • apps/portal/src/app/payments/x402/facilitator/page.mdx (2 hunks)
  • apps/portal/src/app/payments/x402/page.mdx (2 hunks)
  • apps/portal/src/app/transactions/policies/page.mdx (1 hunks)
  • apps/portal/src/app/transactions/sidebar.tsx (1 hunks)
✅ Files skipped from review due to trivial changes (3)
  • apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/account-abstraction/settings/SponsorshipPolicies/index.tsx
  • apps/portal/src/app/transactions/policies/page.mdx
  • apps/portal/src/app/payments/x402/facilitator/page.mdx
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/portal/src/app/payments/x402/page.mdx
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.{ts,tsx}: Write idiomatic TypeScript with explicit function declarations and return types
Limit each file to one stateless, single-responsibility function for clarity
Re-use shared types from @/types or local types.ts barrels
Prefer type aliases over interface except for nominal shapes
Avoid any and unknown unless unavoidable; narrow generics when possible
Choose composition over inheritance; leverage utility types (Partial, Pick, etc.)
Comment only ambiguous logic; avoid restating TypeScript in prose

**/*.{ts,tsx}: Use explicit function declarations and explicit return types in TypeScript
Limit each file to one stateless, single‑responsibility function
Re‑use shared types from @/types where applicable
Prefer type aliases over interface except for nominal shapes
Avoid any and unknown unless unavoidable; narrow generics when possible
Prefer composition over inheritance; use utility types (Partial, Pick, etc.)
Lazy‑import optional features and avoid top‑level side‑effects to reduce bundle size

Files:

  • apps/portal/src/app/payments/sidebar.tsx
  • apps/portal/src/app/transactions/sidebar.tsx
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (CLAUDE.md)

Load heavy dependencies inside async paths to keep initial bundle lean (lazy loading)

Files:

  • apps/portal/src/app/payments/sidebar.tsx
  • apps/portal/src/app/transactions/sidebar.tsx
⏰ 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). (6)
  • GitHub Check: Unit Tests
  • GitHub Check: Size
  • GitHub Check: E2E Tests (pnpm, esbuild)
  • GitHub Check: E2E Tests (pnpm, webpack)
  • GitHub Check: Lint Packages
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (3)
apps/portal/src/app/transactions/sidebar.tsx (1)

45-48: LGTM! Sponsorship Policies link added correctly.

The new navigation link follows the existing pattern and is properly positioned in the Guides section.

apps/portal/src/app/payments/sidebar.tsx (1)

85-85: LGTM! Simplified navigation label.

Renaming from "Facilitator API" to "Facilitator" improves clarity and aligns with the updated documentation.

apps/portal/src/app/payments/x402/client/page.mdx (1)

71-82: LGTM! Documentation correctly reflects the simplified fetch-based flow.

The update from the two-step prepare/sign flow to a single /v1/payments/x402/fetch endpoint is well-documented. The changes include:

  • Simplified parameters (url and from)
  • Updated authentication to use user-wallet-token
  • Clear pass-through behavior for request body
  • Consistent endpoint references

Note: A past review comment has already flagged a stale /prepare reference in the dotnet quickstart docs that should be addressed separately.

Warning

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

Errors (2)
  • TEAM-0000: Entity not found: Issue - Could not find referenced Issue.
  • ERC-2612: Entity not found: Issue - Could not find referenced Issue.

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

@github-actions github-actions bot added the Portal Involves changes to the Portal (docs) codebase. label Oct 2, 2025
@joaquim-verges joaquim-verges changed the title [Docs] Simplify x402 documentation and rename "Facilitator API" to "Facilitator" [Docs] Simplify x402 documentation Oct 2, 2025
@joaquim-verges joaquim-verges marked this pull request as ready for review October 2, 2025 21:29
Copy link
Member Author


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.

@joaquim-verges joaquim-verges requested review from a team as code owners October 2, 2025 21:29
@codecov
Copy link

codecov bot commented Oct 2, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 56.29%. Comparing base (ae3dfa3) to head (8f32dee).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8173   +/-   ##
=======================================
  Coverage   56.29%   56.29%           
=======================================
  Files         906      906           
  Lines       59209    59209           
  Branches     4182     4182           
=======================================
  Hits        33330    33330           
  Misses      25774    25774           
  Partials      105      105           
Flag Coverage Δ
packages 56.29% <ø> (ø)
🚀 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

@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: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between ae3dfa3 and 716123e.

📒 Files selected for processing (4)
  • apps/portal/src/app/payments/sidebar.tsx (1 hunks)
  • apps/portal/src/app/payments/x402/client/page.mdx (1 hunks)
  • apps/portal/src/app/payments/x402/facilitator/page.mdx (2 hunks)
  • apps/portal/src/app/payments/x402/page.mdx (2 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.{ts,tsx}: Write idiomatic TypeScript with explicit function declarations and return types
Limit each file to one stateless, single-responsibility function for clarity
Re-use shared types from @/types or local types.ts barrels
Prefer type aliases over interface except for nominal shapes
Avoid any and unknown unless unavoidable; narrow generics when possible
Choose composition over inheritance; leverage utility types (Partial, Pick, etc.)
Comment only ambiguous logic; avoid restating TypeScript in prose

**/*.{ts,tsx}: Use explicit function declarations and explicit return types in TypeScript
Limit each file to one stateless, single‑responsibility function
Re‑use shared types from @/types where applicable
Prefer type aliases over interface except for nominal shapes
Avoid any and unknown unless unavoidable; narrow generics when possible
Prefer composition over inheritance; use utility types (Partial, Pick, etc.)
Lazy‑import optional features and avoid top‑level side‑effects to reduce bundle size

Files:

  • apps/portal/src/app/payments/sidebar.tsx
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (CLAUDE.md)

Load heavy dependencies inside async paths to keep initial bundle lean (lazy loading)

Files:

  • apps/portal/src/app/payments/sidebar.tsx
⏰ 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). (3)
  • GitHub Check: Lint Packages
  • GitHub Check: Size
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (5)
apps/portal/src/app/payments/sidebar.tsx (1)

85-85: LGTM! Label simplification improves consistency.

The rename from "Facilitator API" to "Facilitator" aligns with the updated documentation title and follows the naming pattern of other sidebar items (e.g., "Client Side", "Server Side").

apps/portal/src/app/payments/x402/facilitator/page.mdx (2)

4-4: LGTM! Title simplification aligns with sidebar.

The title change from "Facilitator API" to "Facilitator" matches the sidebar update and maintains consistency across the documentation.


19-24: LGTM! Valuable technical clarification added.

The new "Chain and token support" section provides important information about EVM chain compatibility and the required token standards (ERC-2612 permit and ERC-3009 transferWithAuthorization for USDC). This helps developers understand the technical requirements upfront.

apps/portal/src/app/payments/x402/page.mdx (2)

36-36: LGTM! Helpful addition clarifying thirdweb API usage.

This paragraph adds context about using the thirdweb API directly to fetch x402-compatible endpoints, improving the documentation's completeness and guiding users to the detailed client-side documentation.


82-82: LGTM! Clear explanation of server-side architecture.

This paragraph effectively explains the middleware approach for handling multiple endpoints and clarifies the facilitator's role in on-chain settlement. The links to detailed documentation are appropriate.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 2, 2025

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 64.6 KB (0%) 1.3 s (0%) 492 ms (+101.98% 🔺) 1.8 s
thirdweb (cjs) 365.75 KB (0%) 7.4 s (0%) 2.5 s (+1.08% 🔺) 9.8 s
thirdweb (minimal + tree-shaking) 5.73 KB (0%) 115 ms (0%) 216 ms (+1632.05% 🔺) 331 ms
thirdweb/chains (tree-shaking) 526 B (0%) 11 ms (0%) 85 ms (+1319.2% 🔺) 95 ms
thirdweb/react (minimal + tree-shaking) 19.13 KB (0%) 383 ms (0%) 177 ms (+1230.7% 🔺) 560 ms

@linear
Copy link

linear bot commented Oct 2, 2025

@joaquim-verges joaquim-verges force-pushed the _Docs_Simplify_x402_documentation_and_rename_Facilitator_API_to_Facilitator_ branch from 716123e to 8f32dee Compare October 2, 2025 21:45
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground October 2, 2025 21:45 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui October 2, 2025 21:45 Inactive
@vercel vercel bot temporarily deployed to Preview – nebula October 2, 2025 21:45 Inactive
@github-actions github-actions bot added the Dashboard Involves changes to the Dashboard. label Oct 2, 2025
@joaquim-verges joaquim-verges merged commit 00b8adf into main Oct 2, 2025
25 checks passed
@joaquim-verges joaquim-verges deleted the _Docs_Simplify_x402_documentation_and_rename_Facilitator_API_to_Facilitator_ branch October 2, 2025 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Dashboard Involves changes to the Dashboard. Portal Involves changes to the Portal (docs) codebase.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants