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

zewstpay-react

v0.1.8

Published

React/Next SDK for ZewstPay payment links with checkout

Readme

zewstpay-react

React SDK for ZewstPay. Easily integrate ZewstPay payment links and checkout into your React or Next.js application.

Installation

npm install zewstpay-react
# or
yarn add zewstpay-react
# or
pnpm add zewstpay-react

Usage

The SDK provides a function initializeZewstPay to open the payment modal.

Basic Example

import { initializeZewstPay } from "zewstpay-react";

function CheckoutButton({ orderCode }) {
  const handleCheckout = () => {
    const handle = initializeZewstPay({
      apiKey: "YOUR_PUBLIC_API_KEY",
      code: orderCode, // The order code from ZewstPay
      environment: "sandbox", // or 'live'
      onSuccess: (data) => {
        console.log("Payment successful:", data);
      },
      onError: (error) => {
        console.error("Payment failed:", error);
      },
      onClose: () => {
        console.log("Payment modal closed");
      },
    });
  };

  return <button onClick={handleCheckout}>Pay Now</button>;
}

Next.js / Server Components

Since initializeZewstPay interacts with the DOM (window/document), ensure you call it from a Client Component or inside a useEffect/event handler where window is defined.

API Reference

initializeZewstPay(options)

Initializes and opens the ZewstPay payment modal.

Parameters:

options: InitializeZewstPayOptions object with the following properties:

| Property | Type | Required | Description | | -------------------- | --------------------------------------- | -------- | ---------------------------------------------------- | | apiKey | string | Yes | Your ZewstPay Public API Key. | | code | string | Yes | The Order Code or Payment Link Identifier. | | environment | 'sandbox' \| 'live' | No | Environment to use. Defaults to 'sandbox'. | | onSuccess | (data: { orderCode: string }) => void | No | Callback fired when payment succeeds. | | onError | (error: any) => void | No | Callback fired when an error occurs. | | onClose | () => void | No | Callback fired when the modal is closed. | | onOpen | () => void | No | Callback fired when the modal opens. | | baseUrl | string | No | Override the base API URL (for advanced usage). | | merchantIdOverride | string | No | Override the Finix Merchant ID (for advanced usage). |

Returns:

ZewstPayHandle object:

  • open(): Re-opens the modal (if closed).
  • close(): Closes the modal programmatically.
  • container: The DOM element containing the modal.

Styling

The modal comes with built-in styles that render it as a centered overlay. It injects a style tag into the DOM.

License

MIT