Skip to content

docs: sync mppx replay and method hooks - #869

Merged
brendanjryan merged 2 commits into
mainfrom
automation/daily-mppx-docs-sync-20260806
Aug 7, 2026
Merged

docs: sync mppx replay and method hooks#869
brendanjryan merged 2 commits into
mainfrom
automation/daily-mppx-docs-sync-20260806

Conversation

@brendanjryan

Copy link
Copy Markdown
Collaborator

Motivation

Keep the TypeScript SDK documentation aligned with upstream public interfaces and runtime behavior.

Summary

  • Document shared atomic replay claims and migrate attestation examples to the core Store
  • Document implicit multi-method intent composition and per-method payment success hooks
  • Update affected guides, SDK references, generated routes, navigation, examples, and the latest published mppx main snapshot

Key design considerations

  • Keep the sync bookmark at cd71f9e5 until npm publishes a snapshot containing the later upstream APIs
  • Keep examples for unpublished APIs as bare TypeScript until they can typecheck against that snapshot

@vercel

vercel Bot commented Aug 7, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
mpp Ready Ready Preview Aug 7, 2026 6:40pm

Request Review

@socket-security

socket-security Bot commented Aug 7, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedmppx@​0.0.0-main-20260805221648812510098100

View full report

@socket-security

socket-security Bot commented Aug 7, 2026

Copy link
Copy Markdown

Warning

Review the following alerts detected in dependencies.

According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.

Action Severity Alert  (click "▶" to expand/collapse)
Warn Critical
Critical CVE: npm mppx has multiple payment bypass and griefing vulnerabilities

CVE: GHSA-8x4m-qw58-3pcx mppx has multiple payment bypass and griefing vulnerabilities (CRITICAL)

Affected versions: < 0.4.8

Patched version: 0.4.8

From: package.jsonnpm/mppx@0.0.0-main-20260805221648

ℹ Read more on: This package | This alert | What is a critical CVE?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Remove or replace dependencies that include known critical CVEs. Consumers can use dependency overrides or npm audit fix --force to remove vulnerable dependencies.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/mppx@0.0.0-main-20260805221648. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

View full report

@brendanjryan
brendanjryan marked this pull request as ready for review August 7, 2026 18:17

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 025748969b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +114 to +116
#### onPaymentSuccess (optional)

- **Type:** `Method.OnPaymentSuccessFn<method>`

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Publish the method hook before documenting it

package.json and .mppx-docs-sync pin the 20260805221648/cd71f9e5 snapshot, but the per-method onPaymentSuccess constructor option comes from later, unpublished upstream changes and isn't exposed by that snapshot's types or runtime. Readers therefore get an unsupported property when following this reference; bump both pins to a release containing the hook or defer these additions until it is published.

AGENTS.md reference: AGENTS.md:L65-L67

Useful? React with 👍 / 👎.

### Create a payment-gated route

The route handler is identical to a single-method setup. `mppx.charge` advertises all registered methods in the Challenge and verifies whichever Credential the client presents.
The route handler is identical to a single-method setup. `mppx.charge` applies the same options to each registered charge method, advertises every resulting offer in the Challenge, and verifies whichever Credential the client presents. Use [`mppx.compose`](/sdk/typescript/server/Mppx.compose) when offers need different options.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Convert the shared amount before offering Lightning

When the guide registers all three shown methods, applying identical options doesn't produce an equivalent price: src/pages/payment-methods/lightning/charge.mdx:143-144 defines Spark's amount in satoshis with BTC as its default currency, while the Tempo and Stripe defaults here are dollar-denominated. Consequently, the primary route's amount: '0.01' requests 0.01 sat over Lightning rather than the promised $0.01; use explicit composition with a method-specific satoshi amount or perform a currency conversion.

AGENTS.md reference: AGENTS.md:L294-L299

Useful? React with 👍 / 👎.

@@ -0,0 +1,65 @@
# `Store.tryClaim` [Claim replay keys atomically]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Add the required social-card frontmatter

This new page starts directly with its H1, so it has neither a description nor an imageDescription; scripts/generate-og-descriptions.ts consequently omits the route and its social previews have no page-specific card copy. Add frontmatter with the required descriptions within the 160- and 80-character limits.

AGENTS.md reference: AGENTS.md:L241-L246

Useful? React with 👍 / 👎.

@brendanjryan
brendanjryan merged commit 52e32a3 into main Aug 7, 2026
11 of 12 checks passed
@brendanjryan
brendanjryan deleted the automation/daily-mppx-docs-sync-20260806 branch August 7, 2026 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant