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

@team-oozoo/oozoo-pay

v0.3.0

Published

OozooPay JavaScript SDK for browser-based crypto payments

Readme

@team-oozoo/oozoo-pay

OOZOO PAY JavaScript SDK for browser-based crypto payments.

Installation

npm install @team-oozoo/oozoo-pay
# or
pnpm add @team-oozoo/oozoo-pay
# or
yarn add @team-oozoo/oozoo-pay

Quick Start

npm / ES Module

import { loadOozooPay } from '@team-oozoo/oozoo-pay';

const client = await loadOozooPay('pk_your_client_key');

await client.pay({
  price: 100,
  unit: 'usd',
  onCreateInvoice: async ({ price, chainId, tokenAddress, sender }) => {
    const res = await fetch('/api/create-invoice', {
      method: 'POST',
      headers: { 'Content-Type': 'application/json' },
      body: JSON.stringify({ price, chainId, tokenAddress, sender }),
    });
    const data = await res.json();
    return data.invoiceId;
  },
  successUrl: '/payment/success',
  failUrl: '/payment/fail',
});

Script Tag (Standalone)

<script src="https://unpkg.com/@team-oozoo/oozoo-pay/dist/standalone.global.js"></script>
<script>
  async function handlePay() {
    const client = await OozooPay.load('pk_your_client_key');
    await client.pay({
      price: 100,
      unit: 'usd',
      onCreateInvoice: async (params) => {
        const res = await fetch('/api/create-invoice', {
          method: 'POST',
          headers: { 'Content-Type': 'application/json' },
          body: JSON.stringify(params),
        });
        const data = await res.json();
        return data.invoiceId;
      },
      successUrl: '/payment/success',
      failUrl: '/payment/fail',
    });
  }
</script>

API

loadOozooPay(clientKey)

Initializes the SDK and returns an OozooPayClient instance.

| Parameter | Type | Required | Description | | ----------- | -------- | -------- | ------------------------- | | clientKey | string | Yes | API Client Key (pk_xxx) |

client.pay(options)

Opens the payment window and processes a payment from the user.

await client.pay({
  price: 100,
  unit: 'usd',
  onCreateInvoice: async (params) => {
    // Create an invoice on your merchant server and return the invoiceId
    return invoiceId;
  },
  successUrl: '/payment/success',
  failUrl: '/payment/fail',
});

| Option | Type | Required | Description | | ----------------- | ----------------------------- | -------- | ------------------------------------------------------------------------- | | price | number | Yes | Payment amount | | unit | 'usd' | No | Currency unit (default: 'usd') | | onCreateInvoice | (params) => Promise<string> | Yes | Invoice creation callback | | successUrl | string | Yes | Redirect URL on success (?invoiceId={id} appended) | | failUrl | string | No | Redirect URL on failure/cancel. If omitted, modal closes without redirect |

onCreateInvoice Parameters

| Field | Type | Description | | -------------- | -------- | ---------------------- | | price | number | Payment amount | | unit | string | Currency unit | | chainId | string | Blockchain chain ID | | tokenAddress | string | Token contract address | | sender | string | Payer's wallet address |

client.transfer(options)

Opens the checkout window to send a payout (withdrawal) to a user. Same interface as pay(), except the onCreateInvoice callback receives receiver instead of sender.

await client.transfer({
  price: 50,
  unit: 'usd',
  onCreateInvoice: async ({ price, chainId, tokenAddress, receiver }) => {
    const res = await fetch('/api/create-transfer', {
      method: 'POST',
      headers: { 'Content-Type': 'application/json' },
      body: JSON.stringify({ price, chainId, tokenAddress, receiver }),
    });
    const data = await res.json();
    return data.invoiceId;
  },
  successUrl: '/transfer/success',
  failUrl: '/transfer/fail',
});

| Option | Type | Required | Description | | ----------------- | ----------------------------- | -------- | ------------------------------------------------------------------------- | | price | number | Yes | Transfer amount | | unit | 'usd' | No | Currency unit (default: 'usd') | | onCreateInvoice | (params) => Promise<string> | Yes | Invoice creation callback | | successUrl | string | Yes | Redirect URL on success (?invoiceId={id} appended) | | failUrl | string | No | Redirect URL on failure/cancel. If omitted, modal closes without redirect |

failUrl Query Parameters

| Scenario | Query Parameters | Example | | ------------- | ---------------------------------- | --------------------------------------- | | User cancel | ?code=CANCELLED | /fail?code=CANCELLED | | Payment error | ?code={ERROR_CODE}&message={msg} | /fail?code=PAYMENT_FAILED&message=... |

Error Handling

The SDK exports typed error classes:

import { OozooPayError, ConfigError, ApiError } from '@team-oozoo/oozoo-pay';

| Error Class | Description | | --------------- | ----------------------------------------------------- | | OozooPayError | Base error class for all SDK errors | | ConfigError | Invalid configuration (missing clientKey, price, etc) | | ApiError | API request failure |

TypeScript

All types are exported for TypeScript users:

import type {
  PayOptions,
  TransferOptions,
  PayInvoiceParams,
  TransferInvoiceParams,
  PaymentConfig,
  PaymentRouter,
  PaymentSetting,
} from '@team-oozoo/oozoo-pay';