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

@beep-it/sdk-core

v0.1.7

Published

Official TypeScript SDK for the BEEP Payment and Invoice Server

Readme

The BEEP PAY SDK: Turn Your Cool Sh*t into Revenue - now on SUI 💸

Accept credit cards, USDC and receive revenue in USDC on SUI wallets

Alright, let's be real. You made something awesome. A game, an app, a digital masterpiece. And now you wanna get paid for it. As you should! But dealing with payments is a whole vibe killer.

That’s where Beep comes in.

Beep makes it stupid simple to accept USDC payments on the SUI network, fully self-custodial, AEO-ready, and AI-native.
No banks. No bridges. No nonsense.


Table of Contents

Which SDK Should I Use?

🖥️ Backend/Server Code?Server-Side SDK (BeepClient)

  • Full API access with secret keys
  • Server-side only (Node.js, Express, etc.)
  • Complete payment processing capabilities
  • Streaming payments support (issuePayment, startStreaming, etc.)

📱 Frontend/Browser Code?Frontend SDK (BeepPublicClient)

  • Safe for client-side code
  • Uses publishable keys (not secret)
  • Perfect for React, Vue, or vanilla JS apps
  • Limited to widget endpoints only (no streaming payments)

🤔 So, like, what even is this?

Think of this SDK as your personal cheat code for money. It's a box of pre-written code that you can just drop into your project to handle all the boring payment stuff.

No, you don't need to know what an "SDK" is. Just know this: this is the easy button.

With this, you can:

  • Give your users a "wallet": It's not a real wallet. It's just a secure spot online for them to keep their digital cash to pay you with. We handle all the scary security stuff.
  • Ask for money (nicely): Create an "invoice," which is just a fancy word for a bill. It's like sending a Venmo request, but for your app.
  • Actually get paid: Process the payment and see the money roll in. Cha-ching.

Basically, we're the ✨ unpaid intern ✨ who handles your finances so you can get back to creating.


Server-Side SDK (BeepClient)

Perfect for Node.js, Express servers, Next.js API routes, and any backend code where you can safely store secret keys.

Server-Side Setup

Step 1: Install the SDK

npm install @beep-it/sdk-core

Step 2: Get Your Secret API Key

  1. Sign up for a BEEP account at app.justbeep.it
  2. Go to your account settings and find your secret API key
  3. Never expose this in client-side code! Keep it on your server only.

Step 3: Initialize BeepClient

import { BeepClient, SupportedToken } from '@beep-it/sdk-core';

const beep = new BeepClient({
  apiKey: 'your_secret_api_key_here', // Keep this secure!
});

Server-Side Making Money

Let's say you want to charge someone 5 USDT for a pack of 100 magic crystals in your game. Here's the complete server-side flow:

The Server-Side Payment Flow

  1. You create an invoice - This is literally just you telling our servers "hey, I want $X for Y reason"
  2. We create an invoice - Think of this as a digital receipt that says "pay this amount pls"
  3. We give you back payment details - This includes:
    • A paymentUrl (a link you can send to your customer)
    • A qrCode (same link but as a scannable QR code for mobile)
    • A referenceKey (a unique ID to track this specific payment)
    • An invoiceId (the invoice ID you can use to check payment status later)
  4. Your user pays - They click the link or scan the code and pay using their crypto wallet
  5. We handle the crypto magic - All the blockchain validation, token transfers, etc.
  6. You get notified - Either through webhooks (if you set those up) or by checking the status
  7. Money lands in your account - Cha-ching! 🤑

Seriously, all you need to worry about is step 1. We handle 2-7 because we're nice like that.

// Server-side invoice creation
const invoiceDetails = {
  description: 'A pack of 100 magic crystals',
  amount: '5.00',
  token: SupportedToken.USDT,
  payerType: 'customer_wallet' as const,
};

try {
  const invoice = await beep.invoices.createInvoice(invoiceDetails);

  // Send this payment info to your frontend
  res.json({
    qrCode: invoice.qrCode,
    paymentUrl: invoice.paymentUrl,
    referenceKey: invoice.referenceKey,
    invoiceId: invoice.id,
  });

  // Later, check if payment completed
  const updatedInvoice = await beep.invoices.getInvoice(invoice.id!);
  if (updatedInvoice.status === 'paid') {
    // Unlock content for the user!
  }
} catch (error) {
  console.error('Invoice creation failed:', error.message);
}

Server-Side API Reference

Creating Invoices

const invoice = await beep.invoices.createInvoice({
  amount: '19.99',
  token: SupportedToken.USDT,
  description: 'VIP Battle Pass',
  payerType: 'customer_wallet',
});

Managing Products

// Create a product
const product = await beep.products.createProduct({
  name: 'Magic Sword',
  price: '9.99',
  token: SupportedToken.USDT,
  isSubscription: false,
});

// List all products
const products = await beep.products.listProducts();

Payment Processing

// Request asset purchase
const payment = await beep.payments.requestAndPurchaseAsset({
  assets: [{ assetId: 'product-uuid', quantity: 1 }],
  generateQrCode: true,
});

// Wait for payment completion
const { paid } = await beep.payments.waitForPaymentCompletion({
  assets: [{ assetId: 'product-uuid', quantity: 1 }],
  paymentReference: payment.referenceKey,
});

Streaming Payments (BeepClient Only)

Important: Streaming payment methods are only available with BeepClient using secret API keys. They do NOT work with BeepPublicClient or publishable keys.

// Issue a streaming payment session
const session = await beep.payments.issuePayment({
  apiKey: 'your_secret_api_key',
  assetChunks: [
    { assetId: 'video-content-uuid', quantity: 1 },
    { assetId: 'api-access-uuid', quantity: 100 }
  ],
  payingMerchantId: 'merchant_who_pays'
});

// Start charging for usage
await beep.payments.startStreaming({
  apiKey: 'your_secret_api_key',
  invoiceId: session.invoiceId
});

// Pause billing temporarily
await beep.payments.pauseStreaming({
  apiKey: 'your_secret_api_key',
  invoiceId: session.invoiceId
});

// Stop and finalize charges
const result = await beep.payments.stopStreaming({
  apiKey: 'your_secret_api_key',
  invoiceId: session.invoiceId
});

Frontend SDK (BeepPublicClient)

Perfect for React, Vue, vanilla JS, or any client-side code where you can't safely store secret keys.

Frontend Setup

Step 1: Install the SDK

npm install @beep-it/sdk-core

Step 2: Get Your Publishable Key

  1. Sign up for a BEEP account at app.justbeep.it
  2. Go to your account settings and find your publishable key (starts with beep_pk_)
  3. This is safe to expose in client-side code!

Step 3: Initialize BeepPublicClient

import { BeepPublicClient, SupportedToken } from '@beep-it/sdk-core';

const publicBeep = new BeepPublicClient({
  publishableKey: 'beep_pk_your_publishable_key_here', // Safe for browsers!
});

Frontend Making Money

Here's how to create a complete payment flow in your React app:

The Frontend Payment Flow

// Create a payment session with mixed assets
const handlePurchase = async () => {
  try {
    const session = await publicBeep.widget.createPaymentSession({
      assets: [
        // Use existing products
        { assetId: 'existing-product-uuid', quantity: 1 },
        // Or create items on-the-fly
        {
          name: 'Custom Magic Potion',
          price: '12.50',
          quantity: 2,
          description: 'Instant health boost',
        },
      ],
      paymentLabel: 'My Awesome Game Store',
    });

    // Show payment URL/QR to user
    setPaymentUrl(session.paymentUrl);
    setReferenceKey(session.referenceKey);

    // Start polling for payment completion
    const { paid } = await publicBeep.widget.waitForPaid({
      referenceKey: session.referenceKey,
      intervalMs: 5000, // Check every 5 seconds
      timeoutMs: 5 * 60 * 1000, // 5 minute timeout
    });

    if (paid) {
      // Payment successful! Unlock content
      setShowSuccessMessage(true);
      unlockPremiumFeatures();
    }
  } catch (error) {
    console.error('Payment failed:', error);
  }
};

Frontend API Reference

Creating Payment Sessions

const session = await publicBeep.widget.createPaymentSession({
  assets: [
    { assetId: 'existing-product', quantity: 1 },
    { name: 'Custom Item', price: '5.99', quantity: 1 },
  ],
  paymentLabel: 'Your Store Name',
});

Checking Payment Status

const status = await publicBeep.widget.getPaymentStatus(referenceKey);
console.log('Payment completed:', status.paid);

Waiting for Payment (with polling)

const { paid, timedOut } = await publicBeep.widget.waitForPaid({
  referenceKey: session.referenceKey,
  intervalMs: 5000,
  timeoutMs: 300000, // 5 minutes
});

🤓 Advanced API Reference

Token Utilities

SupportedToken

Clean token enum instead of remembering addresses:

import { SupportedToken } from '@beep-it/sdk-core';

const token = SupportedToken.USDT; // Much cleaner!

TokenUtils

Advanced token utilities:

import { TokenUtils, SupportedToken } from '@beep-it/sdk-core';

// Get the address from a token enum
const address = TokenUtils.getTokenAddress(SupportedToken.USDT);

// Check if we support a token
const isSupported = TokenUtils.isTokenSupported(SupportedToken.USDT);

// Get a token enum from an address (reverse lookup)
const token = TokenUtils.getTokenFromAddress('Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB');

Resources

Beep llms.txt


License

MIT. Go wild.

Payouts (BeepClient Only)

Initiate a payout from your treasury wallet to an external address. Requires a secret API key and must be called server-side.

Notes:

  • The server derives the source wallet from your API key's merchant and the requested chain; you do not provide a walletId.
  • amount must be provided in the token's smallest units (integer as a string). For USDC with 6 decimals, 1.00 USDC = "1000000".
  • The response indicates acceptance or rejection. Execution happens asynchronously after treasury funds are reserved.

Example:

import { BeepClient } from '@beep-it/sdk-core';

const beep = new BeepClient({ apiKey: process.env.BEEP_API_KEY! });

const result = await beep.createPayout({
  amount: '1000000', // 1.00 USDC (6 decimals)
  destinationWalletAddress: 'DESTINATION_ADDRESS',
  chain: 'SUI',
  token: 'USDC',
});

console.log(result.status, result.message);