Skip to main content

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/sdk

react and react-dom (version 18 or later) are peer dependencies. The button bundles its own wallet and data fetching providers, so the host app needs no prior Sui or dapp kit setup.

What it exports

ExportPurpose
SweemPayButtonA complete drop in button that bundles its own providers
PayModalA standalone modal for apps that already use the Sui dapp kit

It also ships TypeScript types: PaymentResult, CheckoutConfig, TokenConfig, TokenSymbol, and SweemNetwork.

How a payment flows

  1. The merchant generates a publishable key from the dashboard.
  2. The merchant embeds the button with the key, an amount, and a token.
  3. The SDK resolves the key through the public checkout config endpoint, which returns the merchant name, logo, recipient address, and supported tokens.
  4. The payer connects a wallet, confirms the amount, and signs the transfer.
  5. 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.