Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/pages/_api/api/og.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -251,3 +251,10 @@ export async function GET(request: Request) {
},
});
}

export async function HEAD(request: Request) {
const response = await GET(request);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Avoid rendering OG images for HEAD requests

The new HEAD handler delegates to GET, which still initializes WASM, loads fonts, and renders a PNG before discarding the body. In crawler-heavy scenarios that probe OG endpoints with HEAD, this adds unnecessary CPU and latency while providing no extra value over returning headers directly, so it can materially increase load on this API route.

Useful? React with 👍 / 👎.

return new Response(null, {
headers: response.headers,
});
}
2 changes: 0 additions & 2 deletions src/pages/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,4 @@ description: "MPP (Machine Payments Protocol) is the open standard for machine-t

import { LandingPage } from "../components/LandingPage";

<h1 style={{ position: 'absolute', width: '1px', height: '1px', padding: 0, margin: '-1px', overflow: 'hidden', clip: 'rect(0,0,0,0)', whiteSpace: 'nowrap', border: 0 }}>MPP — Machine Payments Protocol</h1>

<LandingPage />
1 change: 1 addition & 0 deletions src/pages/intents/charge.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: "Charge intent for one-time payments"
description: "Charge intent defines one-time payments in MPP. Use it when a client pays once for a request before receiving the resource."
imageDescription: "Collect a one-time payment per API request"
---

Expand Down
1 change: 1 addition & 0 deletions src/pages/payment-methods/card/charge.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
description: "Accept one-time card payments in MPP using encrypted network tokens and card-compatible payment flows."
imageDescription: "One-time card payments with network tokens"
---

Expand Down
1 change: 1 addition & 0 deletions src/pages/payment-methods/card/index.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: "Card payment method"
description: "Use card payments in MPP to accept traditional payment methods with encrypted network tokens."
imageDescription: "Accept card payments with encrypted network tokens"
---

Expand Down
1 change: 1 addition & 0 deletions src/pages/payment-methods/custom.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: "Custom payment methods"
description: "Build a custom MPP payment method with your own request schema, Credential format, and server verification logic."
imageDescription: "Build a custom payment method for MPP"
---

Expand Down
1 change: 1 addition & 0 deletions src/pages/payment-methods/index.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
description: "Compare MPP payment methods and choose the right rails for your API, app, or agent workflow."
imageDescription: "Choose a payment method for your service"
---

Expand Down
1 change: 1 addition & 0 deletions src/pages/payment-methods/lightning/charge.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
description: "Accept one-time Bitcoin payments over Lightning with BOLT11 invoices and MPP charge flows."
imageDescription: "One-time Lightning payments for API calls"
---

Expand Down
1 change: 1 addition & 0 deletions src/pages/payment-methods/lightning/index.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
description: "Use Lightning payment methods in MPP for Bitcoin charges and prepaid session access."
imageDescription: "Instant Bitcoin payments over Lightning"
---

Expand Down
1 change: 1 addition & 0 deletions src/pages/payment-methods/lightning/session.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
description: "Accept pay-as-you-go Lightning payments with prepaid sessions and per-request billing."
imageDescription: "Stream payments over Lightning"
---

Expand Down
2 changes: 1 addition & 1 deletion src/pages/payment-methods/monad/charge.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
description: "Accept one-time Monad payments with ERC-20 transfers or ERC-3009 authorizations."
imageDescription: "One-time Monad payments using ERC-20 transfers or ERC-3009 authorizations"
---

Expand Down Expand Up @@ -79,4 +80,3 @@ Monad charge supports two settlement modes:

- **Push** — the client broadcasts an ERC-20 `transfer(recipient, amount)` transaction on-chain and includes the transaction hash in the credential. The server verifies the transfer by reading `Transfer` event logs.
- **Pull** — the client signs an ERC-3009 `transferWithAuthorization` off-chain. The server broadcasts the authorization on-chain via `transferWithAuthorization`, paying the gas. The server account does not need to match the recipient address.

1 change: 1 addition & 0 deletions src/pages/payment-methods/monad/index.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
description: "Use Monad payment methods in MPP for ERC-20 token payments with push and pull settlement modes."
imageDescription: "ERC-20 token payments on Monad with push and pull settlement modes"
---

Expand Down
1 change: 1 addition & 0 deletions src/pages/payment-methods/solana/charge.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
description: "Accept one-time Solana payments in MPP with signed transactions or confirmed signatures."
imageDescription: "One-time Solana payments for API calls"
---

Expand Down
1 change: 1 addition & 0 deletions src/pages/payment-methods/solana/index.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
description: "Use Solana payment methods in MPP to accept SOL and SPL token payments."
imageDescription: "Accept SOL and SPL token payments on Solana"
---

Expand Down
1 change: 1 addition & 0 deletions src/pages/payment-methods/stellar/charge.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
description: "Accept one-time Stellar token payments in MPP using SEP-41 assets and server-side verification."
imageDescription: "One-time stablecoin payments on Stellar"
---

Expand Down
1 change: 1 addition & 0 deletions src/pages/payment-methods/stellar/index.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: "Stellar SEP-41 token payments"
description: "Use Stellar payment methods in MPP to accept SEP-41 token payments and channel-based sessions."
imageDescription: "Accept stablecoin payments on the Stellar network"
---

Expand Down
1 change: 1 addition & 0 deletions src/pages/payment-methods/stellar/session.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
description: "Accept high-frequency Stellar payments with one-way payment channels and pay-as-you-go billing."
imageDescription: "High-frequency payments with Stellar payment channels"
---

Expand Down
1 change: 1 addition & 0 deletions src/pages/payment-methods/stripe/charge.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
description: "Accept one-time Stripe payments in MPP with Shared Payment Tokens and browser payment flows."
imageDescription: "One-time card payments via Stripe"
---

Expand Down
1 change: 1 addition & 0 deletions src/pages/payment-methods/stripe/index.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: "Stripe payment method"
description: "Use Stripe payment methods in MPP to accept cards, wallets, and other Stripe-supported payment methods."
imageDescription: "Accept cards and wallets via Stripe"
---

Expand Down
1 change: 1 addition & 0 deletions src/pages/payment-methods/tempo/charge.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
description: "Accept one-time stablecoin payments on Tempo with signed TIP-20 token transfers."
imageDescription: "One-time stablecoin payments on Tempo"
---

Expand Down
1 change: 1 addition & 0 deletions src/pages/payment-methods/tempo/index.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: "Tempo stablecoin payments"
description: "Use Tempo payment methods in MPP for stablecoin charges and low-cost payment sessions."
imageDescription: "Fast, low-cost stablecoin payments on Tempo"
---

Expand Down
1 change: 1 addition & 0 deletions src/pages/payment-methods/tempo/session.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
description: "Accept pay-as-you-go stablecoin payments on Tempo with payment channels and off-chain vouchers."
imageDescription: "Stream payments with low-cost sessions on Tempo"
---

Expand Down
1 change: 1 addition & 0 deletions src/pages/protocol/challenges.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
description: "Create MPP Challenges that tell clients what a resource costs, which method to use, and when the payment request expires."
imageDescription: "Tell clients what to pay and how"
---

Expand Down
1 change: 1 addition & 0 deletions src/pages/protocol/credentials.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
description: "Verify MPP Credentials from clients and bind payment proofs to the original server-issued Challenge."
imageDescription: "Submit proof of payment with each request"
---

Expand Down
1 change: 1 addition & 0 deletions src/pages/protocol/transports/mcp.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
description: "Use the MCP transport to require payment for JSON-RPC tool calls while preserving MPP Challenges, Credentials, and Receipts."
imageDescription: "Pay for AI tool calls over MCP"
---

Expand Down
1 change: 1 addition & 0 deletions src/pages/sdk/go/client.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
description: "Use the Go client to handle HTTP 402 responses, pay with supported methods, and retry requests automatically."
imageDescription: "Handle paid APIs automatically in Go"
---

Expand Down
1 change: 1 addition & 0 deletions src/pages/sdk/go/core.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
description: "Use Go core types for MPP Challenges, Credentials, Receipts, payment requests, and verification flows."
imageDescription: "Core MPP types for Go"
---

Expand Down
1 change: 1 addition & 0 deletions src/pages/sdk/go/index.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
description: "Use the Go SDK to build MPP clients and servers with typed Challenge, Credential, and Receipt primitives."
imageDescription: "MPP client and server library for Go"
---

Expand Down
1 change: 1 addition & 0 deletions src/pages/sdk/go/server.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
description: "Use the Go server SDK to protect HTTP endpoints with MPP payment requirements and verification."
imageDescription: "Charge for your Go API endpoints"
---

Expand Down
1 change: 1 addition & 0 deletions src/pages/sdk/python/client.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: "Python MPP client"
description: "Use the Python client to handle HTTP 402 responses, pay with supported methods, and retry requests automatically."
imageDescription: "Handle paid APIs automatically in Python"
---

Expand Down
1 change: 1 addition & 0 deletions src/pages/sdk/python/core.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
description: "Use Python core types for MPP Challenges, Credentials, Receipts, payment requests, and verification flows."
imageDescription: "Core MPP types for Python"
---

Expand Down
1 change: 1 addition & 0 deletions src/pages/sdk/python/index.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
description: "Use the Python SDK to build MPP clients and servers with typed Challenge, Credential, and Receipt primitives."
imageDescription: "MPP client and server library for Python"
---

Expand Down
1 change: 1 addition & 0 deletions src/pages/sdk/python/server.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
description: "Use the Python server SDK to protect FastAPI endpoints with MPP payment requirements and verification."
imageDescription: "Charge for your Python API endpoints"
---

Expand Down
1 change: 1 addition & 0 deletions src/pages/sdk/ruby/client.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
description: "Use the Ruby client to handle HTTP 402 responses, pay with supported methods, and retry requests automatically."
imageDescription: "Handle paid APIs automatically in Ruby"
---

Expand Down
1 change: 1 addition & 0 deletions src/pages/sdk/ruby/core.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
description: "Use Ruby core types for MPP Challenges, Credentials, Receipts, payment requests, and verification flows."
imageDescription: "Core MPP types for Ruby"
---

Expand Down
1 change: 1 addition & 0 deletions src/pages/sdk/ruby/index.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
description: "Use the Ruby SDK to build MPP clients and servers with typed Challenge, Credential, and Receipt primitives."
imageDescription: "MPP client and server library for Ruby"
---

Expand Down
1 change: 1 addition & 0 deletions src/pages/sdk/ruby/server.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
description: "Use the Ruby server SDK to protect Rack endpoints with MPP payment requirements and verification."
imageDescription: "Charge for your Ruby API endpoints"
---

Expand Down
1 change: 1 addition & 0 deletions src/pages/sdk/rust/client.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
description: "Use the Rust client to handle HTTP 402 responses, pay with supported methods, and retry requests automatically."
imageDescription: "Handle paid APIs automatically in Rust"
---

Expand Down
1 change: 1 addition & 0 deletions src/pages/sdk/rust/core.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
description: "Use Rust core types for MPP Challenges, Credentials, Receipts, payment requests, and verification flows."
imageDescription: "Core MPP types for Rust"
---

Expand Down
1 change: 1 addition & 0 deletions src/pages/sdk/rust/index.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: "Rust SDK for MPP"
description: "Use the Rust SDK to build MPP clients and servers with typed Challenge, Credential, and Receipt primitives."
imageDescription: "High-performance MPP library for Rust"
---

Expand Down
1 change: 1 addition & 0 deletions src/pages/sdk/rust/server.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
description: "Use the Rust server SDK to protect Axum endpoints with MPP payment requirements and verification."
imageDescription: "Charge for your Rust API endpoints"
---

Expand Down
1 change: 1 addition & 0 deletions src/pages/sdk/typescript/cli.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
description: "Use the mppx CLI to make paid HTTP requests from the terminal with automatic MPP payment handling."
imageDescription: "Make paid API requests from the terminal"
---

Expand Down
1 change: 1 addition & 0 deletions src/pages/sdk/typescript/core/Expires.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: "Expires utility functions"
description: "Use Expires helpers to set relative expiration timestamps for MPP Challenges and payment requests."
imageDescription: "Set expiration times for payment requests"
---

Expand Down
1 change: 1 addition & 0 deletions src/pages/sdk/typescript/index.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
description: "Use the mppx TypeScript SDK to build MPP clients, servers, middleware, and payment-aware fetch flows."
imageDescription: "MPP client and server library for TypeScript"
---

Expand Down
12 changes: 11 additions & 1 deletion vercel.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ const OPENAPI_DISCOVERY_LINK_VALUE = [
'</.well-known/agent-skills/index.json>; rel="describedby"; type="application/json"',
].join(", ");

const CONTENT_NEGOTIATION_HEADERS = [header("Vary", "Accept, User-Agent")];

const API_CATALOG_HEADERS = [
header("Access-Control-Allow-Origin", "*"),
header("Cache-Control", "public, max-age=300"),
Expand Down Expand Up @@ -59,10 +61,18 @@ export const config = {
headerRule("/robots.txt", CACHE_HEADERS),
headerRule("/openapi.json", [header("Link", OPENAPI_DISCOVERY_LINK_VALUE)]),
...DISCOVERY_PAGE_SOURCES.map((source) =>
headerRule(source, [header("Link", DOC_DISCOVERY_LINK_VALUE)]),
headerRule(source, [
header("Link", DOC_DISCOVERY_LINK_VALUE),
...CONTENT_NEGOTIATION_HEADERS,
]),
),
],
redirects: [
{
source: "/index",
destination: "/",
permanent: true,
},
{
source: "/openapi.json",
destination: "/api/openapi.json",
Expand Down
25 changes: 25 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,30 @@ function contentSignalsRobotsTxt(): Plugin {
};
}

function pruneSitemap(): Plugin {
return {
name: "prune-sitemap",
enforce: "post",
async writeBundle(options) {
if (!options.dir?.endsWith("/public")) return;

const sitemapPath = path.join(options.dir, "sitemap.xml");
const current = await fs.readFile(sitemapPath, "utf8").catch((error) => {
if ((error as NodeJS.ErrnoException).code === "ENOENT") return null;
throw error;
});
if (!current) return;

const next = current.replace(
/\s*<url>\s*<loc>[^<]*\/404<\/loc>\s*<lastmod>[^<]+<\/lastmod>\s*<\/url>/,
"",
);

if (next !== current) await fs.writeFile(sitemapPath, next, "utf8");
},
};
}

export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), "");
for (const key of Object.keys(env)) {
Expand All @@ -137,6 +161,7 @@ export default defineConfig(({ mode }) => {
react(),
vocs(),
contentSignalsRobotsTxt(),
pruneSitemap(),
...(mode !== "production"
? [mkcert({ force: true, hosts: ["localhost"] })]
: []),
Expand Down
2 changes: 2 additions & 0 deletions vocs.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ export default defineConfig({
colorScheme: "light dark",
baseUrl,
redirects: [
{ source: "/index", destination: "/" },

// Aliases for overview
{ source: "/docs", destination: "/overview" },
{ source: "/documentation", destination: "/overview" },
Expand Down
Loading