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

@zevpay/react

v0.1.0

Published

React components and hooks for ZevPay Checkout

Readme

@zevpay/react

React components and hooks for ZevPay Checkout. Drop-in payment UI powered by @zevpay/inline.

Installation

npm install @zevpay/react @zevpay/inline

Requires React 18 or later.

Quick start

Button component

import { ZevPayButton } from '@zevpay/react';

function CheckoutPage() {
  return (
    <ZevPayButton
      apiKey="pk_test_your_public_key"
      email="[email protected]"
      amount={500000} // ₦5,000 in kobo
      onSuccess={(reference) => {
        console.log('Payment successful:', reference);
        // Verify payment on your server
      }}
    >
      Pay ₦5,000
    </ZevPayButton>
  );
}

Hook

import { useZevPayCheckout } from '@zevpay/react';

function CheckoutPage() {
  const { openCheckout } = useZevPayCheckout({
    apiKey: 'pk_test_your_public_key',
    onSuccess: (reference) => {
      console.log('Payment successful:', reference);
    },
  });

  return (
    <button onClick={() => openCheckout({
      email: '[email protected]',
      amount: 500000,
    })}>
      Pay ₦5,000
    </button>
  );
}

Provider (shared API key)

import { ZevPayProvider, ZevPayButton } from '@zevpay/react';

function App() {
  return (
    <ZevPayProvider apiKey="pk_test_your_public_key">
      <ProductPage />
    </ZevPayProvider>
  );
}

function ProductPage() {
  return (
    <ZevPayButton email="[email protected]" amount={500000}>
      Pay ₦5,000
    </ZevPayButton>
  );
}

API

<ZevPayButton />

| Prop | Type | Required | Description | |------|------|----------|-------------| | apiKey | string | Yes* | Public API key (pk_live_* or pk_test_*) | | email | string | Yes | Customer email address | | amount | number | Yes | Amount in kobo (₦1 = 100 kobo) | | currency | string | No | Currency code (default: "NGN") | | reference | string | No | Your unique transaction reference | | firstName | string | No | Customer first name | | lastName | string | No | Customer last name | | metadata | object | No | Custom metadata | | paymentMethods | "all" | string[] | No | Payment methods to show | | onSuccess | (reference: string) => void | No | Called on successful payment | | onClose | () => void | No | Called when modal closes | | onError | (error: Error) => void | No | Called on error | | onFailure | (error?: Error) => void | No | Called on payment failure | | onExpired | () => void | No | Called when session expires | | onInitialize | () => void | No | Called on session init | | children | ReactNode | No | Button content (default: "Pay Now") | | className | string | No | CSS class for the button | | disabled | boolean | No | Disable the button |

*Required unless <ZevPayProvider> is used.

useZevPayCheckout(config)

Returns { openCheckout } — call openCheckout(params) to open checkout.

Config (shared options):

| Option | Type | Description | |--------|------|-------------| | apiKey | string | Public API key (or use Provider) | | currency | string | Currency code | | paymentMethods | "all" | string[] | Payment methods | | onSuccess | function | Success callback | | onClose | function | Close callback | | onError | function | Error callback | | onFailure | function | Failure callback | | onExpired | function | Expiry callback | | onInitialize | function | Init callback |

openCheckout params (per-call):

| Param | Type | Required | Description | |-------|------|----------|-------------| | email | string | Yes | Customer email | | amount | number | Yes | Amount in kobo | | reference | string | No | Transaction reference | | firstName | string | No | Customer first name | | lastName | string | No | Customer last name | | metadata | object | No | Custom metadata |

<ZevPayProvider>

| Prop | Type | Required | Description | |------|------|----------|-------------| | apiKey | string | Yes | Shared public API key | | children | ReactNode | Yes | Child components |

Amounts

All amounts are in kobo (minor currency units):

| Naira | Kobo | |-------|------| | ₦100 | 10,000 | | ₦1,000 | 100,000 | | ₦5,000 | 500,000 |

Server-side verification

Always verify payments on your server after onSuccess:

import ZevPay from '@zevpay/node';

const zevpay = new ZevPay('sk_live_xxx');
const result = await zevpay.checkout.verify(sessionId);

if (result.status === 'completed') {
  // Payment confirmed
}

License

MIT