Documentation

Wire Bitcoin-native paywalls in minutes.

This SDK syncs your Supabase tables, analytics Edge Function, and Clarity revenue splits into a single integration surface. Select an asset rail below and drop the component anywhere React renders.

SDK Quickstart

01

Install

Install the SDK and import the Paywall primitives.

pnpm add @x402pay/sdk
02

Configure

Register content + assets in Supabase or via Edge Functions.

x402pay.register({ contentId, asset, price })
03

Launch

Drop the PaywallButton or use the REST hooks for agents.

<PaywallButton contentId="pro-pack" asset="STX" />
Security Checklist
  • Hiro Wallet connected & signature verified
  • Content registered in revenue-split Clarity map
  • Supabase access_grants policy enabled
  • Analytics processor Edge Function deployed

sBTC Rail

Bitcoin security, L2 speed

  • Multi-sig settlement
  • Bridged via x402
  • Ideal for premium drops
Drop-in Component
import { PaywallButton } from '@x402pay/sdk'

<PaywallButton
  contentId="sbtc-drop"
  asset="sBTC"
  price={0.001}
/>

End-to-end flow

Signal

User or AI agent signs a Hiro wallet intent.

Contract

Revenue-split Clarity contract settles + logs analytics event.

Access

Supabase grants access, SDK unlocks premium content instantly.