Rewrite V2 SDK Getting Started pages#23
Conversation
Replace mechanical AI-generated pages with docs that lead with motivation, use real addresses, and vary structure per page type: - overview: landing page with x402 vs x402r contrast - installation: shortest page, straight to install command - create-client: decision tree between full client and role presets - typescript: reference sheet with role narrowing tables Follows DOCS_WRITING_GUIDE.md anti-slop rules. All signatures verified against types.ts. Broken-links check passes. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Hide stale V1 pages (Merchant, Client, Arbiter, Facilitator, Experimental groups) from the sidebar. Files remain on disk for the cleanup PR which will delete them and add redirects. SDK tab now shows only V2 Getting Started pages. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace descriptive reference pages with code-heavy tutorials matching the x402 getting-started pattern: - overview: brief intro + links to quickstarts - merchant-quickstart: install → deploy → create client → authorize → release - payer-quickstart: create client → check state → request refund → freeze → evidence Numbered steps, mostly code, minimal prose between blocks. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add no-em-dash and CodeGroup rules to CLAUDE.md - Replace all em dashes with commas, periods, or rewrites - Wrap all install commands in CodeGroup (npm/pnpm/bun) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- arbiter-quickstart: 8 numbered steps covering dispute review, approve/deny, unfreeze, and fee distribution - examples: links to all SDK examples with run commands - deploy-operator: fix V2 API (chainId instead of network string), add refundRequest/evidence to return type, fix broken nav links - docs.json: add arbiter quickstart + Resources group Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add icons to all quickstart pages (store, user, gavel) - Rename "SDK Overview" to "Overview" - Add arbiter to overview's Quickstarts CardGroup - Remove Summary sections (just repeat the steps) - Remove References sections (npm/GitHub links) - Replace Next Steps bullet lists with CardGroup cards - Remove duplicate network table from deploy-operator, link to overview as single source of truth Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Merchant: Deploy Operator (full config), Protocol Overview, Examples - Payer: Arbiter Quickstart (what happens to your refund), Protocol Overview, Examples - Arbiter: Deploy Operator (how you're configured), Smart Contracts (access control), Examples Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
viem is a regular dependency of @x402r/sdk (not a peer dep), so it installs automatically. No need to list it explicitly. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Deploy is a one-time setup (has its own page). Authorization is handled by the payer/facilitator, not the merchant directly. Merchant quickstart now starts from "payment arrived in escrow" which is the merchant's actual first interaction. Install simplified to just @x402r/sdk. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Code reviewFound 8 issues:
docs/sdk/merchant-quickstart.mdx Lines 61 to 76 in 8a2b99f
Lines 119 to 155 in 8a2b99f
Lines 6 to 8 in 8a2b99f
Lines 10 to 12 in 8a2b99f
Lines 17 to 20 in 8a2b99f
Lines 50 to 52 in 8a2b99f
Lines 88 to 90 in 8a2b99f
Lines 1 to 10 in 8a2b99f 🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
Review fixes: 1. Fix broken code fence in merchant-quickstart (nested opening) 2. Fix MarketplaceOperatorDeployment interface to match source: summary.newCount/existingCount, txHashes inside summary, remove non-existent arbiterConditionAddress 3. Delete orphaned pages (create-client, installation, typescript) that were not in nav, fixing em dash violations in those files 4. Fix "merchants authorize" to "merchants receive" in overview (payer signs, facilitator submits, not the merchant) 5. Fix Monad USDC checksum (lowercase a to uppercase A) 6. Redirect 7 broken /sdk/installation links to /sdk/overview Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- arbiter-quickstart: landing page explaining both models with comparison table, links to the two tutorials - arbiter-dispute: existing dispute flow (moved from arbiter-quickstart) - arbiter-delivery: new page for automated evaluation flow using deployDeliveryProtectionOperator() and forwardToArbiter() - overview: add "Two Operator Models" section - docs.json: add arbiter-dispute and arbiter-delivery to nav Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace the placeholder extractPaymentInfo() with the real SDK helpers: - parseForwardedPayload() for typed PaymentInfo extraction - fromNetworkId() for CAIP-2 chain ID parsing - createArbiterClient() instead of full createX402r() Closes x402r-sdk#100 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Code review (re-review after updates)Previous 8 issues are all fixed. Found 7 new issues, mostly in the new
Lines 66 to 68 in a4a6757 Lines 90 to 92 in a4a6757
Lines 36 to 38 in a4a6757
Lines 23 to 25 in a4a6757 Lines 157 to 159 in a4a6757
Lines 116 to 118 in a4a6757
Lines 61 to 68 in a4a6757
Lines 203 to 205 in a4a6757
docs/x402-integration/overview.mdx Lines 219 to 221 in a4a6757 🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
Nav changes: - "Getting Started" renamed to "Marketplace" (it is the marketplace flow) - New "Delivery Protection" section with overview, merchant, arbiter pages - New "Resources" section with create-client, deploy-operator, examples Page changes: - arbiter-quickstart: flattened back to dispute resolution content - delivery-protection: overview with comparison table - delivery-merchant: deploy operator + forwardToArbiter() setup - delivery-arbiter: build arbiter service + parseForwardedPayload() - create-client: broad reference for createX402r / role presets / config Review fixes: - RefundRequestStatus: 3=Cancelled, 4=Refused (was wrong) - CREATE2 -> CREATE3 in deploy-operator (2 places) - CommerceEvmScheme -> registerCommerceEvmScheme (server-side) - "Authorize payments" -> "Accept payments" on merchant card - "SDK Installation" -> "SDK Overview" on protocol card - Created x402r-sdk#102 for missing deployDeliveryProtectionOperator export Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Code review (round 3)All 7 issues from round 2 are fixed. Found 4 new issues:
Lines 36 to 38 in 13b4ef3
Lines 55 to 57 in 13b4ef3
docs/sdk/delivery-merchant.mdx Lines 90 to 95 in 13b4ef3 Lines 64 to 69 in 13b4ef3
Lines 46 to 48 in 13b4ef3 Lines 157 to 159 in 13b4ef3 🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
Nav restructure: - Overview is now top-level (not under Marketplace) - "Quickstart for X" removed everywhere. New titles: Merchant Guide, Payer Guide, Arbiter Guide - Files renamed: merchant.mdx, payer.mdx, arbiter.mdx Install fixes: - delivery-merchant: @x402r/core @x402r/helpers (dropped @x402r/sdk, merchant doesn't create SDK client on this page) - delivery-arbiter: @x402r/sdk @x402r/helpers (dropped express) - overview: @x402r/helpers only (dropped @x402r/evm) Review fixes (round 3): 1. fromNetworkId imported from @x402r/core (not exported from sdk) 2. "merchant action" reworded to "not part of the payer role" 3. Payload JSON shape fixed to show actual nested structure 4. Double spaces in deploy-operator replaced with punctuation Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Factual fixes: - Add SKALE Base to chain table (chainId: 1187947933) - Remove outdated #102 note from delivery-merchant - Add deployDeliveryProtectionOperator section to deploy-operator - Fix double spaces in deploy-operator (em dash remnants) Remove repeated boilerplate: - Type narrowing explanation removed from merchant, payer, arbiter (function names are self-explanatory, create-client has reference) - Install CodeGroup trimmed to one-liner in marketplace role guides Add Mintlify warnings: - Merchant: release() reverts during escrow - Payer: freeze() blocks release, timing note for escrow window - Arbiter: refundInEscrow() auto-approves (no undo), deny vs refuse - Delivery merchant: forwardToArbiter is fire-and-forget - Delivery arbiter: service downtime means no evaluation Nav: deploy-operator top-level, Resources -> Reference, create-client title -> Client Configuration Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Empty group name caused Mintlify to not resolve a default page for the SDK tab. Named it "Getting Started". Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- create-client title: "Create x402r Client" (was "Client Configuration") - deploy-operator: collapse reference sections into Accordions (deployment result type, preview addresses, slot configs) Keeps the main deploy flow visible, hides detail until needed Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The entire "Deploy Your Operator" Steps section (clone, .env.example, pnpm start, deploy-short-escrow.ts) referenced a deploy-operator example directory that does not exist in the SDK. Removed all fabricated content. The SDK programmatic deployment code remains. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Deploy is already on the deploy-operator page. Link there instead of repeating 30 lines of deploy code. Page now focuses on what the merchant actually does: configure forwardToArbiter(). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Merchant, payer, and arbiter had bare npm install without pnpm/bun tabs. Now consistent with all other pages. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
) ## Summary Consolidates all 14 open Mintlify bot PRs into a single PR for review. Merged oldest-first with `--no-ff -X theirs` so each PR's intent is preserved as a discrete merge commit and later PRs supersede earlier ones where they overlap. ## Consolidated PRs | # | Title | |---|---| | #19 | Update SDK docs for @x402r/sdk API and new chain support | | #20 | Sync SDK docs with contracts v3 API | | #21 | Replace `refundable()` with `forwardToArbiter()` in SDK docs | | #22 | Add delivery protection operator docs, fix marketplace operator signature | | #24 | Add `forwardToArbiter` docs and named address constants | | #25 | Document `DeliveryProtectionOperator` preset exports | | #26 | Update delivery protection SDK docs for v2 | | #27 | Remove `ArbiterRegistry` references from SDK docs | | #28 | Add ERC-8004 plugin docs to SDK reference | | #29 | Update SDK docs to match `@x402r/sdk` 0.2.x API | | #30 | Add ERC-8004 helpers and `identity.check()` SDK docs | | #31 | Fix broken internal links in cursor AI tools guide | | #32 | Add `@x402r/cli` documentation | | #33 | Document commerce-payments v1 addresses, remove SKALE Base | ## Conflict resolutions The V2 SDK Getting Started rewrite (#23) landed on `main` after most of these PRs were opened, so several conflicts had to be resolved: - **`sdk/installation.mdx`** — V2 rewrite intentionally deleted this file. Kept the deletion; dropped PR #19, #20, and #24 modifications. - **`sdk/helpers/refundable.mdx`** — PR #21 deletes this page (replaces with `forward-to-arbiter.mdx`). Accepted the deletion; later PRs that modified `refundable.mdx` (PR #24) had their refundable-touching parts dropped. - **`docs.json`** — V2 rewrite kept `sdk/helpers/refundable` in nav. PR #21's `theirs`-strategy merge added `forward-to-arbiter` but the V2 entry for `refundable` was preserved as a dangling reference. Removed in the final fix commit so the Mintlify build doesn't fail. - **All other content conflicts** — resolved with `-X theirs` (incoming Mintlify PR wins). Newer PRs in the chronological merge order override older PRs where they touch the same lines. ## Verification - `python3 -m json.tool docs.json` — valid JSON - All deleted-file references checked: no remaining links to `sdk/installation` or `sdk/helpers/refundable` - Diff stat: 29 files changed, ~2,332 insertions, ~2,091 deletions ## Next steps (for reviewer) 1. Skim merge commits in order to see what each upstream PR contributed. 2. After merging, close PRs #19-#22 and #24-#33 with a comment pointing here. 3. Run `npx mint dev` locally to verify rendering before merging. --------- Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary
Replaces PR #18 with a full rewrite of the 4 Getting Started pages following the new DOCS_WRITING_GUIDE anti-slop rules.
What changed:
sdk/overview.mdx— landing page feel, leads with x402 vs x402r contrast, real chain tablessdk/installation.mdx— shortest page on the site, jumps straight to install commandsdk/create-client.mdx— decision tree betweencreateX402r()and role presets, config referencesdk/typescript.mdx— reference sheet with role narrowing tables verified againsttypes.tsdocs.json— addscreate-clientandtypescriptto Getting Started nav, removesconceptsandlimitationsWriting approach:
config/index.ts, not placeholdersx402r-sdk/packages/sdk/src/types.tsTest plan
npx mintlify broken-linkspassestypes.tsgetChainConfigconfirmed re-exported from@x402r/sdk🤖 Generated with Claude Code