Skip to content

docs(review): address Greptile review feedback across the stack - #96

Merged
rodrigopavezi merged 3 commits into
mainfrom
docs/revamp-greptile-fixes
May 12, 2026
Merged

docs(review): address Greptile review feedback across the stack#96
rodrigopavezi merged 3 commits into
mainfrom
docs/revamp-greptile-fixes

Conversation

@rodrigopavezi

Copy link
Copy Markdown
Contributor

Applies 16 of 18 Greptile review comments from PRs #88-95. Skipped:

PR #88

  • getting-started.mdx: replaced the "API Key Generation" steps with the
    Client ID flow on the Dashboard.

PR #89

  • secure-payment-supported-networks-and-currencies.mdx: qualified the
    cross-chain note — Tron payments are same-chain; Li.Fi swap-to-pay
    is EVM-source only.
  • release-notes/request-api.mdx: distinguished the four "2026-Q1"
    Update blocks with topical sub-labels (Payouts, Tron, Accounting,
    Calldata).

PR #90

  • docs.json: removed the duplicate tools/dashboard entry from the API
    Setup group. The Tools group in Resources is the canonical home.
  • programmatic-payment-links.mdx: TS/Python/cURL switched from
    to per AGENTS.md style. Other Tabs blocks (EVM-vs-Tron
    variants) stay as Tabs since they are alternative content.
  • programmatic-payment-links.mdx: fixed the timingSafeEqual signature
    check to compare decoded buffer lengths instead of raw hex string
    lengths.

PR #91

  • package.json: dropped @playwright/test (only playwright is used).
  • scripts/capture-screenshots.ts: switched waitUntil from "networkidle"
    to "load". Vite HMR keeps a persistent WebSocket open so networkidle
    always timed out against dev servers.

PR #92

  • integration-tutorial.mdx: changed the webhook-section .env placeholder
    from <YOUR_API_KEY> to <YOUR_CLIENT_ID> for consistency.

PR #93

  • secure-payments.mdx: rewrote the redirectUrl description to remove
    the self-contradiction ("redirected" vs "no auto-redirect").
  • programmatic-payment-links.mdx: the "send back to your site" code
    example now captures the response and uses securePaymentUrl.

PR #94

  • payee-destinations.mdx: accessPolicy sub-fields restructured from a
    Markdown table to with nested entries.
  • compliance-gated-payments.mdx: "How it works" numbered list switched
    to with components.

PR #95

  • multi-chain-checkout.mdx: "you decide of the destination" →
    "you decide on the destination" (grammar).
  • batch-payouts.mdx: removed the duplicate "hosted" in the Mode 1
    description.
  • welcome.mdx: dropped the SDK framing — the Dashboard and Secure
    Payment Page are no-code hosted tools, not SDK consumers.

This was referenced May 11, 2026
@rodrigopaveziGraphite App

rodrigopavezi commented May 11, 2026

Copy link
Copy Markdown
ContributorAuthor

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

@greptile-apps

greptile-appsBot commented May 11, 2026

Copy link
Copy Markdown

Greptile Summary

This PR applies 16 of 18 Greptile review items from PRs #88–95, covering credential naming (RN_API_KEYRN_CLIENT_ID, x-api-keyx-client-id), component upgrades (<Tabs><CodeGroup>, numbered lists → <Steps>, Markdown tables → <Expandable>), and several correctness fixes.

  • Credential rename is applied consistently across getting-started.mdx, integration-tutorial.mdx, create-requests.mdx, batch-payments.mdx, payouts.mdx, and the cURL registration snippets.
  • Code correctness: timingSafeEqual now compares decoded buffer lengths instead of raw hex string lengths; crosschain-payments.mdx adds createPublicClient for waitForTransactionReceipt; the redirectUrl example now captures the response and exposes securePaymentUrl.
  • Documentation quality: release-note labels disambiguated with topical sub-labels, expiresAt example corrected to 7 days, duplicate nav entry removed from docs.json, and multiple typos fixed.

Confidence Score: 4/5

Safe to merge after fixing the webhook signature example in getting-started.mdx.

The Getting Started webhook snippet now uses express.json() to parse the body, then computes an HMAC over JSON.stringify(req.body). Because the webhook provider signs raw bytes, the re-serialized form will not match and every webhook delivery will return 401. The correct pattern — shown in programmatic-payment-links.mdx — uses express.raw() so the raw bytes are hashed directly. All other changes in this PR (credential renames, component upgrades, timingSafeEqual fix, crosschain publicClient, nav dedup) are accurate and well-executed.

api-setup/getting-started.mdx — the webhook handler body-parsing middleware conflicts with its own HMAC verification logic.

Important Files Changed

FilenameOverview
api-setup/getting-started.mdxUpdated Client ID flow and added missing Express setup for webhook example, but the new express.json() body parser is incompatible with the existing JSON.stringify-based HMAC check.
use-cases/programmatic-payment-links.mdxCorrectly migrated Tabs to CodeGroup, fixed timingSafeEqual buffer-length comparison, and captured fetch response for securePaymentUrl.
api-features/crosschain-payments.mdxAdded createPublicClient import and usage for waitForTransactionReceipt; publicClient is correctly used in the approval transaction wait step.
api-features/payee-destinations.mdxConverted accessPolicy sub-fields from Markdown table to Expandable + ParamField structure per AGENTS.md component guidelines.
api-setup/integration-tutorial.mdxRenamed RN_API_KEY → RN_CLIENT_ID throughout, added eq import from drizzle-orm (used in two query clauses), fixed succesfully typo.
scripts/capture-screenshots.tsSwitched waitUntil from networkidle to load with explanatory comment; resolves Vite HMR persistent WebSocket timeout.
release-notes/request-api.mdxAdded topical sub-labels (Payouts, Tron, Accounting, Calldata) to the four 2026-Q1 Update blocks to disambiguate duplicate labels.
api-features/crypto-to-fiat-payments.mdxAdded /v2/ prefix to all payer endpoints, fixed Mermaid participant alias, corrected I**mportant formatting typo in Warning block.
docs.jsonRemoved duplicate tools/dashboard entry from the API Setup group; the Tools group in Resources remains the canonical location.
package.jsonRemoved @playwright/test dev dependency since the project uses the playwright package directly rather than the test runner.

Sequence Diagram

sequenceDiagram
participant Dev as Developer
participant GS as getting-started.mdx
participant PPL as programmatic-payment-links.mdx
participant WH as Webhook Handler
Dev->>GS: Copy webhook snippet
GS->>WH: app.use(express.json()) — body parsed as object
WH->>WH: JSON.stringify(req.body) HMAC re-serialized bytes
WH-->>Dev: Signature mismatch (401)
Dev->>PPL: Copy webhook snippet
PPL->>WH: "express.raw({ type: application/json }) — raw bytes preserved"
WH->>WH: createHmac.update(req.body) HMAC raw bytes
WH-->>Dev: Signature matches (200)
Loading

Comments Outside Diff (1)

  1. api-setup/getting-started.mdx, line 171-186 (link)

    P1Webhook signature check will silently fail with express.json()

    This PR added app.use(express.json()) so that req.body is a parsed object rather than undefined, but the HMAC is then computed over JSON.stringify(req.body) — a re-serialized form that may differ from the raw bytes the server signed (different key order, whitespace, number encoding). The companion example in use-cases/programmatic-payment-links.mdx correctly uses express.raw({ type: "application/json" }) and hashes req.body directly as a Buffer. Following the Getting Started snippet will produce a signature that never matches, so every webhook will return 401.

Reviews (4): Last reviewed commit: "docs(review): finish /v2/ prefix consist..." | Re-trigger Greptile

Comment threaduse-cases/programmatic-payment-links.mdx Outdated
Comment threadapi-setup/integration-tutorial.mdx
rodrigopavezi added a commit that referenced this pull request May 11, 2026
Bundles two passes of Greptile feedback:
(A) PR #96 follow-up — the fixes PR itself attracted two new comments:
- use-cases/programmatic-payment-links.mdx: cURL language tag bash → curl
- RN_API_KEY → RN_CLIENT_ID and X-Api-Key → x-client-id renamed across
api-setup/integration-tutorial.mdx, api-setup/getting-started.mdx,
api-features/create-requests.mdx for stack-wide consistency. Zero
RN_API_KEY / X-Api-Key references remain.
(B) Older PRs (51-87) — 23 still-applicable comments out of 51 total.
The other 28 are stale (resolved by the revamp rewriting or removing
the relevant sections/files); those will be resolved on GitHub with a
note explaining staleness.
PR #53 — getting-started.mdx
- Added Express setup (express + app.use(express.json())) before the
webhook handler example so the snippet is runnable.
PR #54 — integration-tutorial.mdx
- Added missing `import { eq } from 'drizzle-orm';`.
- Fixed spelling "succesfully" → "successfully".
PR #55 — create-requests.mdx
- v2 pay endpoint takes requestId, not paymentReference (mermaid +
code sample updated to `${requestId}/pay`).
PR #56 + #87 — crosschain-payments.mdx
- Boundary wording: "under \$1" → "of \$1 or less" to align with the
"greater than 1 USD" half of the sentence.
- viem snippet now imports createPublicClient + http and instantiates
publicClient so `publicClient.waitForTransactionReceipt(...)` works.
PR #57 — batch-payments.mdx
- Code samples now use x-client-id (consistent with rest of docs),
dropped legacy x-platform-id, added `if (!response.ok)` error handling
on both examples.
PR #59 — crypto-to-fiat-payments.mdx
- "I**mportant:" → "**Important:"
- mermaid: {payerId} → {clientUserId} (twice).
- Endpoint paths: /payer → /v2/payer for consistency.
- mermaid: declared "Payee Bank" as a participant (was used but never
declared, breaking the diagram).
PR #66 — query-payments.mdx
- Frontmatter description: /payments → /v2/payments.
PR #67 — platform-fees.mdx
- Clarified query- vs body-param scope: GET /v2/request/{id}/pay uses
query params; POST /v2/payouts and /payouts/batch use body params.
PR #68 — protocol-fees.mdx
- Grammar: "protocol fees applies" → "protocol fee applies".
- Typo: "simple reduce" → "simply reduce".
- Math: payee receives 999.50 USDC (not 999.95). Added intermediate
invoice/fee lines for transparency.
PR #77 — faq.mdx
- On-ramp question now explicitly answered: "Fiat-to-crypto (on-ramp)
payments are not currently supported by the API."
PR #86 — payouts.mdx
- "ERC-712" → "EIP-712" (correct EIP designation).
PR #86 — api-reference/secure-payments.mdx
- expiresAt example: 15 minutes → 7 days, matching the documented
default expiry.
PR #87 — payouts.mdx
- Added "500" row to error-handling table.
mintlify broken-links: zero.
Comment threadapi-features/crypto-to-fiat-payments.mdx Outdated

@MantisCloneMantisClone left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed the cumulative 40-PR stack against 6 source repos (request-api, request-auth-api, request-secure-payment, request-dashboard, request-token-list, request-infrastructure) plus the live preview at requestnetwork-docs-revamp-greptile-fixes.mintlify.app.

Two must-fix items below. Non-blocking observations will be filed as separate issues after deploy.

Must-fix #1 — SIWE example doesn't match server output

File: api-reference/wallet-authentication.mdx:35 (not in this PR's specific diff, so flagging here instead of inline)

The current message example shows a Chain ID: 1 line, omits an Expiration Time: line, and is missing the period after Sign in to Request Network. The actual server template at request-auth-api/src/auth/auth.service.ts:187-196 emits no Chain ID, always emits Expiration Time: (5 min after Issued At), and ends Sign in to Request Network. with a period.

Three edits:

  • Drop the Chain ID: 1 line
  • Add Expiration Time: <iso8601> (5 minutes after Issued At)
  • Add the period: Sign in to Request Network.

Corrected example:

auth.request.network wants you to sign in with your Ethereum account:
0x6923831ACf5c327260D7ac7C9DfF5b1c3cB3C7D7
Sign in to Request Network.
URI: https://auth.request.network
Version: 1
Nonce: a1b2c3d4e5f6
Issued At: 2026-03-15T10:00:00.000Z
Expiration Time: 2026-03-15T10:05:00.000Z

Why it matters: signature verification is byte-exact. Anyone typing the example verbatim to test will get Invalid challenge and have no way to figure out why.

Must-fix #2 — Client ID Generation flow doesn't match Dashboard UI

See inline comment on api-setup/getting-started.mdx.


Already handled

  • bassgeta's CHANGES_REQUESTED on #54 has been dismissed
  • Code Sandbox link drop on api-setup/integration-tutorial.mdx:8 is in Rodrigo's queue (the workspaceId query parameter is user-scoped, so the link doesn't work for any non-author reader)

Comment threadapi-setup/getting-started.mdx

@MantisCloneMantisClone left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Must-fix items from prior review have been addressed in PR #97 (now sitting on top of this PR). SIWE message in wallet-authentication.mdx and Client ID Generation flow in getting-started.mdx both fixed correctly. Approving #96 to clear the review record — the stack is ready to ship.

@rodrigopaveziGraphite App

rodrigopavezi commented May 12, 2026

Copy link
Copy Markdown
ContributorAuthor

Merge activity

  • May 12, 4:02 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • May 12, 5:23 PM UTC: Graphite rebased this pull request as part of a merge.
  • May 12, 5:23 PM UTC: @rodrigopavezi merged this pull request with Graphite.

@rodrigopavezi
rodrigopavezi changed the base branch from docs/revamp-tristan-feedback to graphite-base/96May 12, 2026 17:19
@rodrigopavezi
rodrigopavezi changed the base branch from graphite-base/96 to mainMay 12, 2026 17:21
Applies 16 of 18 Greptile review comments from PRs #88-95. Skipped:
- PR #88 forward-links comment (resolved by Phase B in #90 — pages now
exist)
- PR #91 lockfile exclusion (P2 opinion; team has chosen to gitignore)
PR #88
- getting-started.mdx: replaced the "API Key Generation" steps with the
Client ID flow on the Dashboard.
PR #89
- secure-payment-supported-networks-and-currencies.mdx: qualified the
cross-chain note — Tron payments are same-chain; Li.Fi swap-to-pay
is EVM-source only.
- release-notes/request-api.mdx: distinguished the four "2026-Q1"
Update blocks with topical sub-labels (Payouts, Tron, Accounting,
Calldata).
PR #90
- docs.json: removed the duplicate tools/dashboard entry from the API
Setup group. The Tools group in Resources is the canonical home.
- programmatic-payment-links.mdx: TS/Python/cURL switched from <Tabs>
to <CodeGroup> per AGENTS.md style. Other Tabs blocks (EVM-vs-Tron
variants) stay as Tabs since they are alternative content.
- programmatic-payment-links.mdx: fixed the timingSafeEqual signature
check to compare decoded buffer lengths instead of raw hex string
lengths.
PR #91
- package.json: dropped @playwright/test (only `playwright` is used).
- scripts/capture-screenshots.ts: switched waitUntil from "networkidle"
to "load". Vite HMR keeps a persistent WebSocket open so networkidle
always timed out against dev servers.
PR #92
- integration-tutorial.mdx: changed the webhook-section .env placeholder
from <YOUR_API_KEY> to <YOUR_CLIENT_ID> for consistency.
PR #93
- secure-payments.mdx: rewrote the redirectUrl description to remove
the self-contradiction ("redirected" vs "no auto-redirect").
- programmatic-payment-links.mdx: the "send back to your site" code
example now captures the response and uses securePaymentUrl.
PR #94
- payee-destinations.mdx: accessPolicy sub-fields restructured from a
Markdown table to <Expandable> with nested <ParamField> entries.
- compliance-gated-payments.mdx: "How it works" numbered list switched
to <Steps> with <Step> components.
PR #95
- multi-chain-checkout.mdx: "you decide of the destination" →
"you decide on the destination" (grammar).
- batch-payouts.mdx: removed the duplicate "hosted" in the Mode 1
description.
- welcome.mdx: dropped the SDK framing — the Dashboard and Secure
Payment Page are no-code hosted tools, not SDK consumers.
Bundles two passes of Greptile feedback:
(A) PR #96 follow-up — the fixes PR itself attracted two new comments:
- use-cases/programmatic-payment-links.mdx: cURL language tag bash → curl
- RN_API_KEY → RN_CLIENT_ID and X-Api-Key → x-client-id renamed across
api-setup/integration-tutorial.mdx, api-setup/getting-started.mdx,
api-features/create-requests.mdx for stack-wide consistency. Zero
RN_API_KEY / X-Api-Key references remain.
(B) Older PRs (51-87) — 23 still-applicable comments out of 51 total.
The other 28 are stale (resolved by the revamp rewriting or removing
the relevant sections/files); those will be resolved on GitHub with a
note explaining staleness.
PR #53 — getting-started.mdx
- Added Express setup (express + app.use(express.json())) before the
webhook handler example so the snippet is runnable.
PR #54 — integration-tutorial.mdx
- Added missing `import { eq } from 'drizzle-orm';`.
- Fixed spelling "succesfully" → "successfully".
PR #55 — create-requests.mdx
- v2 pay endpoint takes requestId, not paymentReference (mermaid +
code sample updated to `${requestId}/pay`).
PR #56 + #87 — crosschain-payments.mdx
- Boundary wording: "under \$1" → "of \$1 or less" to align with the
"greater than 1 USD" half of the sentence.
- viem snippet now imports createPublicClient + http and instantiates
publicClient so `publicClient.waitForTransactionReceipt(...)` works.
PR #57 — batch-payments.mdx
- Code samples now use x-client-id (consistent with rest of docs),
dropped legacy x-platform-id, added `if (!response.ok)` error handling
on both examples.
PR #59 — crypto-to-fiat-payments.mdx
- "I**mportant:" → "**Important:"
- mermaid: {payerId} → {clientUserId} (twice).
- Endpoint paths: /payer → /v2/payer for consistency.
- mermaid: declared "Payee Bank" as a participant (was used but never
declared, breaking the diagram).
PR #66 — query-payments.mdx
- Frontmatter description: /payments → /v2/payments.
PR #67 — platform-fees.mdx
- Clarified query- vs body-param scope: GET /v2/request/{id}/pay uses
query params; POST /v2/payouts and /payouts/batch use body params.
PR #68 — protocol-fees.mdx
- Grammar: "protocol fees applies" → "protocol fee applies".
- Typo: "simple reduce" → "simply reduce".
- Math: payee receives 999.50 USDC (not 999.95). Added intermediate
invoice/fee lines for transparency.
PR #77 — faq.mdx
- On-ramp question now explicitly answered: "Fiat-to-crypto (on-ramp)
payments are not currently supported by the API."
PR #86 — payouts.mdx
- "ERC-712" → "EIP-712" (correct EIP designation).
PR #86 — api-reference/secure-payments.mdx
- expiresAt example: 15 minutes → 7 days, matching the documented
default expiry.
PR #87 — payouts.mdx
- Added "500" row to error-handling table.
mintlify broken-links: zero.
Greptile follow-up on api-features/crypto-to-fiat-payments.mdx:127-129.
The earlier fix added the /v2/ prefix to POST /v2/payer but missed the
sibling GET and PATCH entries on the next lines — fixed now. All
relative /payer/... references on the page use the versioned path.
@rodrigopavezi
rodrigopaveziforce-pushed the docs/revamp-greptile-fixes branch from a3a72c9 to a7af9e7CompareMay 12, 2026 17:22
@rodrigopavezi
rodrigopavezi merged commit 6565e40 into mainMay 12, 2026
3 checks passed
@rodrigopavezi
rodrigopavezi deleted the docs/revamp-greptile-fixes branch May 12, 2026 17:23
Sign up for freeto 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

@rodrigopavezi@MantisClone