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

@paystreamer/sdk

v0.4.0

Published

PayStreamer SDK for integrating recurring billing on Sui

Readme

@paystreamer/sdk

The official TypeScript/React SDK for PayStreamer, providing non-custodial recurring subscriptions and billing infrastructure on the Sui blockchain.

Features

  • Core Client: PTB builders and chain queries for the full subscription lifecycle — accounts, tiers, payments, treasury management.
  • ⚛️ React Hooks: Pre-built hooks (useSubscribe, usePlatform, useUserAccount, usePusdBalance, useSponsoredTransaction, etc.).
  • 🎨 UI Components: Turnkey components including SetupSubscriptionModal and TestnetFaucetButton.
  • Sponsored Transactions: Gas station integration for gasless user transactions.
  • 🔀 Multi-Token Routing: Pay or bill in any token via DeepBook, converted to the platform's settlement currency in the same PTB (@paystreamer/sdk/core/deepbook, optional peer dependency).
  • 🔒 Seal & Walrus: Helpers for gating decrypted content on real subscription status (@paystreamer/sdk/core/seal, @paystreamer/sdk/core/walrus, optional peer dependencies).

Compatibility

Tested against this exact combination — other versions may work but aren't verified:

| Package | Version | | --- | --- | | @mysten/sui | 2.23.1 | | @mysten/dapp-kit-react | 2.1.10 | | @mysten/dapp-kit-core | 1.6.8 | | @tanstack/react-query | ^5.90.16 | | react / react-dom | ^18.2.0 \|\| ^19.0.0 | | Node.js | 20+ | | Sui CLI (for local dev) | 1.75.x |

@mysten/sui, @mysten/dapp-kit-react, and @tanstack/react-query are peer dependencies — install them alongside the SDK, and keep them at the versions above until a new compatibility matrix is published here.

Installation

pnpm add @paystreamer/sdk @mysten/[email protected] @mysten/[email protected] @tanstack/react-query

Quick Start

1. React Setup

PayStreamer sits on top of dApp Kit's createDAppKit/DAppKitProvider, which manages the wallet connection and the Sui client. Wrap that with PayStreamerProvider, which carries the PayStreamer-specific contract addresses for whichever network you target.

import { createDAppKit, DAppKitProvider } from "@mysten/dapp-kit-react";
import { SuiGrpcClient } from "@mysten/sui/grpc";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { PayStreamerProvider, getConfig, CLOCK_OBJECT_ID } from "@paystreamer/sdk";

const queryClient = new QueryClient();
const sdkConfig = getConfig("testnet");

const dAppKit = createDAppKit({
  networks: ["testnet"],
  defaultNetwork: "testnet",
  createClient: (network) =>
    new SuiGrpcClient({
      network,
      baseUrl: `https://fullnode.${network}.sui.io:443`,
    }),
});

function App({ children }: { children: React.ReactNode }) {
  return (
    <QueryClientProvider client={queryClient}>
      <DAppKitProvider dAppKit={dAppKit}>
        <PayStreamerProvider
          config={{
            network: "testnet",
            packageId: sdkConfig.PACKAGE_ID,
            registryId: sdkConfig.COIN_TYPE_REGISTRY_ID,
            clockId: CLOCK_OBJECT_ID,
            pusdPackageId: sdkConfig.PUSD_PACKAGE_ID,
            pusdType: sdkConfig.PUSD_TYPE_ARG,
            pusdTreasuryCapId: sdkConfig.PUSD_TREASURY_CAP_ID,
            pusdTreasuryCapInitVersion: sdkConfig.PUSD_TREASURY_CAP_INIT_VERSION,
          }}
        >
          {children}
        </PayStreamerProvider>
      </DAppKitProvider>
    </QueryClientProvider>
  );
}

2. Open Subscription Modal

import { useState } from 'react';
import { SetupSubscriptionModal } from '@paystreamer/sdk/ui';

export function SubscribeButton({ platformId }: { platformId: string }) {
  const [isOpen, setIsOpen] = useState(false);

  return (
    <>
      <button onClick={() => setIsOpen(true)}>
        Subscribe Now
      </button>

      <SetupSubscriptionModal
        isOpen={isOpen}
        onClose={() => setIsOpen(false)}
        platformId={platformId}
        tierIndex={0}
        onSuccess={(digest) => {
          console.log('Subscription created!', digest);
        }}
      />
    </>
  );
}

Modular Exports

  • @paystreamer/sdk — Main bundle entry point (re-exports core + react + ui)
  • @paystreamer/sdk/core — PTB builders, chain queries, and event queries
  • @paystreamer/sdk/react — React hooks and context providers
  • @paystreamer/sdk/ui — React UI components and modal dialogs
  • @paystreamer/sdk/core/seal, @paystreamer/sdk/core/deepbook, @paystreamer/sdk/core/walrus — optional integrations, each behind its own optional peer dependency. These are deliberately not re-exported from @paystreamer/sdk/core — importing any of them there would make every consumer's bundler resolve @mysten/seal/@mysten/deepbook-v3/@mysten/walrus even if unused, which broke real builds before this split existed. Install only the peer dependency you actually need.

Documentation

Full guides at docs.usepaystreamer.xyz, including a complete Core API Reference and a generated TypeDoc reference for exact type signatures.

License

MIT