SDK Overview
The Sweem checkout SDK lets any website accept payments on Sui with a drop in React component. A merchant generates a publishable key, embeds a button, and receives funds directly to their wallet. Sweem never holds the money.
Package
@sweem/react
The package ships dual module and CommonJS builds and lists React and React DOM as peer dependencies.
What it exports
| Export | Purpose |
|---|---|
SweemPayButton | A complete drop in button that bundles its own providers |
PayModal | A standalone modal for apps that already use the Sui dapp kit |
SweemProvider | A wallet and query context wrapper for the button or modal |
fetchCheckoutConfig | Resolves a publishable key to merchant details |
buildPaymentTx | Builds the token transfer transaction |
How a payment flows
- The merchant generates a publishable key from the dashboard.
- The merchant embeds the button with the key, an amount, and a token.
- The SDK resolves the key through the public checkout config endpoint, which returns the merchant name, logo, recipient address, and supported tokens.
- The payer connects a wallet, confirms the amount, and signs the transfer.
- The transfer settles directly to the merchant recipient address, and the success callback fires with the transaction digest.
Supported tokens
The checkout currently supports USDC and SUI. The recipient address is resolved server side from the publishable key, with an optional per key override, so the merchant never has to expose a wallet address in client code.
Reading on
Start with the Quick Start to add a button in a few lines. Then see API Keys for key management and Payment Links for the no code sharing flow.