For Clients
When you make an x402 payment through the Dexter facilitator, the settlement response may include sponsored recommendations — relevant tools or APIs suggested by advertisers. The SDK provides typed helpers to extract and act on these recommendations.
Node.js
React
The useX402Payment hook automatically populates sponsoredRecommendations after a payment completes and fires the impression beacon.
Full Extension Data
For advanced use cases, getSponsoredAccessInfo() returns the complete extension payload including tracking URLs:
Types
All types are re-exported from @dexterai/x402-ads-types:
OpenDexter (x402_fetch)
If you use OpenDexter (via npx @dexterai/opendexter install, open.dexter.cash/mcp, or dexter.cash/mcp), sponsored recommendations are surfaced automatically when you call x402_fetch.
OpenDexter uses getSponsoredRecommendations() from the SDK to extract recommendations from the payment receipt, with a fallback that checks data._x402_sponsored in the response body. It fires fireImpressionBeacon() automatically.
The LLM sees the recommendations in the tool output as:
The _recommendations_hint field is a human-readable summary the LLM can act on directly. If the agent decides the recommendation is useful, it calls x402_fetch with the resourceUrl — and that's a conversion.
This works across all three OpenDexter surfaces: the npm package (v1.2.0+), the hosted Open MCP, and the authenticated MCP toolset.
How Conversions Work
If an agent sees a recommendation and calls the suggested resource, the facilitator automatically detects this and records a conversion. No extra code is needed — the correlation is based on:
- Same payer wallet
- Called the recommended resource URL
- Within a 30-minute window of seeing the recommendation
- Both transactions are on-chain, providing cryptographic proof