npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@sweem/sdk

v0.1.0

Published

Drop-in crypto checkout for React — accept USDC & SUI payments on the Sui network with a single component.

Readme

@sweem/sdk

A drop in crypto checkout component for React. Accept USDC and SUI payments on the Sui network with a single component. Sweem handles wallet connection, the on chain transfer, and the confirmation experience, so you can collect payments without writing any blockchain code.

Overview

The package exposes a SweemPayButton component. When a customer clicks it, a checkout modal opens, the customer connects a Sui wallet, selects a token, and pays your receiving address. Your application is notified with the transaction digest once the payment is confirmed.

The component bundles its own wallet and data fetching providers, so the host application does not need any prior Sui or dapp-kit setup.

Installation

npm install @sweem/sdk

react and react-dom (version 18 or later) are peer dependencies and are expected to be present in the host project.

Getting an API key

  1. Sign in to the Sweem dashboard.
  2. Open Developer, then API keys.
  3. Generate a publishable key. It has the form pk_live_... and maps to your organization's receiving wallet.

Publishable keys are safe to ship in client side code. Store the key in an environment variable.

NEXT_PUBLIC_SWEEM_API_KEY=pk_live_xxxxxxxxxxxxxxxx

Quick start

import { SweemPayButton } from "@sweem/sdk";

export function Checkout() {
  return (
    <SweemPayButton
      apiKey={process.env.NEXT_PUBLIC_SWEEM_API_KEY!}
      amount={49.99}
      onSuccess={(result) => console.log("Paid. Transaction:", result.digest)}
    >
      Pay 49.99
    </SweemPayButton>
  );
}

Props

| Prop | Type | Required | Description | | :--- | :--- | :--- | :--- | | apiKey | string | Yes | Your publishable key. | | amount | number | Yes | The amount to charge, expressed in whole token units. | | token | "USDC" \| "SUI" | No | Lock the payment to a single token. Omit to let the customer choose. | | network | "mainnet" \| "testnet" \| "devnet" | No | The Sui network to use. Defaults to mainnet. | | onSuccess | (result: PaymentResult) => void | No | Called with the transaction digest after a confirmed payment. | | onError | (error: Error) => void | No | Called when a payment fails. | | render | (open: () => void) => ReactNode | No | Render a custom trigger instead of the default button. |

PaymentResult contains digest, amount, token, and recipient.

Choosing a token

Pass the token prop to charge a specific asset and hide the token selector.

<SweemPayButton apiKey={KEY} amount={10} token="USDC" />

Custom trigger

Use the render prop to connect the checkout flow to your own button or menu item.

<SweemPayButton
  apiKey={KEY}
  amount={10}
  render={(open) => <button onClick={open}>Checkout</button>}
/>

Using an existing dapp-kit setup

If your application already wraps the @mysten/dapp-kit providers, render the modal directly and reuse the existing wallet context instead of the bundled provider.

import { PayModal } from "@sweem/sdk";

<PayModal open={open} onClose={close} apiKey={KEY} amount={20} />;

Local development

To test the flow before configuring a key, pass recipient (and optionally merchant) to bypass the backend lookup.

<SweemPayButton
  apiKey="pk_test"
  amount={1}
  recipient="0xYOUR_RECEIVING_ADDRESS"
  merchant="Acme"
/>

How payments settle

The customer's wallet transfers the selected token to the receiving address associated with your API key. Settlement happens directly on the Sui network. The onSuccess callback returns the transaction digest, which can be viewed on Suiscan at https://suiscan.xyz/mainnet/tx/<digest>.

TypeScript

The package ships with type definitions. The exported types include PaymentResult, CheckoutConfig, TokenConfig, TokenSymbol, and SweemNetwork.

License

MIT