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

@pouchpay/widget

v0.13.26

Published

React widget component for PouchPay - Embeddable crypto on/off-ramp for African markets

Readme

@pouchpay/widget

Embeddable React widget for crypto on/off-ramp in African markets

npm version License: MIT

A React component that enables seamless cryptocurrency buying (onramp) and selling (offramp) directly within your application. Built specifically for African markets with support for local payment methods and currencies.

Features

  • 🚀 Simple Integration - Drop-in React component or vanilla JavaScript
  • 💰 Onramp & Offramp - Support for both buying and selling crypto
  • 🌍 African-Focused - Optimized for Nigerian Naira (NGN) with more currencies coming
  • 🎨 Customizable - White-label support with theming options
  • 📱 Mobile-Friendly - Responsive design that works on all devices
  • 🔒 Secure - Built-in KYC and identity verification
  • Real-time Updates - Live transaction status tracking
  • 💳 Local Payment Methods - Bank transfers and other local payment options

Supported Assets

  • Stablecoins: USDT, USDC
  • Networks: TRC20 (TRON), ERC20 (Ethereum), Polygon, BSC, Base, and more
  • Fiat Currencies: NGN (Nigerian Naira)

Installation

npm

npm install @pouchpay/widget

yarn

yarn add @pouchpay/widget

pnpm

pnpm add @pouchpay/widget

Quick Start

React Integration

import { PouchPayWidget } from '@pouchpay/widget';

function App() {
  return (
    <PouchPayWidget
      walletAddress="0x742d35Cc6634C0532925a3b844Bc454e4438f44e"
      cryptoCurrency="USDT"
      cryptoNetwork="TRC20"
      variant="modal"
      apiKey={process.env.REACT_APP_POUCHPAY_API_KEY}
    />
  );
}

Next.js Integration

The widget works seamlessly with Next.js (both App Router and Pages Router). Just add the 'use client' directive since the widget is a client-side component.

'use client';
import { PouchPayWidget } from '@pouchpay/widget';

export default function Page() {
  return (
    <PouchPayWidget
      walletAddress="0x742d35Cc6634C0532925a3b844Bc454e4438f44e"
      cryptoCurrency="USDT"
      cryptoNetwork="TRC20"
      variant="modal"
      apiKey={process.env.NEXT_PUBLIC_POUCHPAY_API_KEY}
    />
  );
}

Note: The widget is compatible with both React 18 and React 19, so it works with all Next.js versions including the latest App Router.

Vanilla JavaScript

<!DOCTYPE html>
<html>
<head>
  <script crossorigin src="https://unpkg.com/react@18/umd/react.production.min.js"></script>
  <script crossorigin src="https://unpkg.com/react-dom@18/umd/react-dom.production.min.js"></script>
</head>
<body>
  <div id="pouchpay-widget"></div>

  <script src="https://unpkg.com/@pouchpay/widget/dist/pouchpay-widget.umd.cjs"></script>
  <script>
    PouchPayWidget.init({
      walletAddress: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e',
      cryptoCurrency: 'USDT',
      cryptoNetwork: 'TRC20',
      variant: 'inline',
      apiKey: 'your-api-key'
    });
  </script>
</body>
</html>

Integration Modes

The widget supports three integration modes to fit different use cases:

1. Minimal Configuration (Recommended)

MoonPay-style integration where users choose whether to buy or sell crypto and enter the amount inside the widget.

<PouchPayWidget
  walletAddress="0x742d35Cc6634C0532925a3b844Bc454e4438f44e"
  cryptoCurrency="USDT"
  cryptoNetwork="TRC20"
  variant="modal"
  apiKey="your-api-key"
/>

Best for: Embedded widgets where you want users to configure everything inside.

2. Full Configuration

You specify type (onramp/offramp), amount, and all parameters upfront.

<PouchPayWidget
  createSession={{
    type: 'ONRAMP',
    walletAddress: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e',
    cryptoCurrency: 'USDT',
    cryptoNetwork: 'TRC20',
    amount: 100,
    countryCode: 'NG',
    currency: 'NGN',
  }}
  variant="inline"
  apiKey="your-api-key"
/>

Best for: Checkout flows where users already selected everything in your UI.

3. Hybrid Mode

Pre-select type and/or amount, but users can still change them.

<PouchPayWidget
  walletAddress="0x742d35Cc6634C0532925a3b844Bc454e4438f44e"
  cryptoCurrency="USDT"
  cryptoNetwork="TRC20"
  type="ONRAMP"        // Pre-select buy
  amount={100}         // Pre-fill amount
  variant="modal"
  apiKey="your-api-key"
/>

Best for: Guided flows where you want to help users but still give them control.

API Reference

PouchPayWidgetProps

| Prop | Type | Required | Description | |------|------|----------|-------------| | apiKey | string | Yes | Your PouchPay API key from the dashboard | | walletAddress | string | For onramp | Destination wallet address (required for buying crypto) | | cryptoCurrency | string | No | Crypto asset (e.g., 'USDT', 'USDC') | | cryptoNetwork | string | No | Network (e.g., 'TRC20', 'ERC20', 'POLYGON') | | variant | 'modal' \| 'inline' | No | Display mode (default: 'modal') | | type | 'ONRAMP' \| 'OFFRAMP' | No | Transaction type (onramp = buy, offramp = sell) | | amount | number | No | Fiat amount for onramp or crypto amount for offramp | | createSession | CreateSessionRequest | No | Full session configuration object | | sessionId | string | No | Resume an existing session | | theme | 'light' \| 'dark' \| 'auto' | No | Color theme (default: 'light') | | onSessionUpdate | (session) => void | No | Callback when session state changes | | onSuccess | (session) => void | No | Callback when transaction completes | | onError | (error) => void | No | Callback when an error occurs | | onClose | () => void | No | Callback when widget is closed (modal only) |

CreateSessionRequest

Full configuration object for creating a session:

type CreateSessionRequest = {
  type: 'ONRAMP' | 'OFFRAMP';
  walletAddress?: string;        // Required for onramp
  cryptoCurrency: string;        // e.g., 'USDT', 'USDC'
  cryptoNetwork: string;         // e.g., 'TRC20', 'ERC20'
  amount?: number;               // Fiat amount for onramp
  cryptoAmount?: number;         // Crypto amount for offramp
  countryCode: string;           // e.g., 'NG'
  currency: string;              // e.g., 'NGN'
};

Advanced Usage

Custom Container

For more control over where the widget renders:

import { mountPouchPayWidget } from '@pouchpay/widget';

const container = document.getElementById('my-custom-container');
const widget = mountPouchPayWidget({
  container,
  props: {
    walletAddress: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e',
    cryptoCurrency: 'USDT',
    cryptoNetwork: 'TRC20',
    apiKey: 'your-api-key'
  }
});

// Later, cleanup when done
widget.unmount();

Event Handling

Track session updates and handle completion:

<PouchPayWidget
  walletAddress="0x742d35..."
  cryptoCurrency="USDT"
  cryptoNetwork="TRC20"
  apiKey="your-api-key"
  onSessionUpdate={(session) => {
    console.log('Session status:', session.status);
    console.log('Current step:', session.nextStep);
  }}
  onSuccess={(session) => {
    console.log('Transaction completed!');
    console.log('Transaction hash:', session.txHash);
  }}
  onError={(error) => {
    console.error('Error:', error);
  }}
/>

Resuming Sessions

Resume an existing session by ID:

<PouchPayWidget
  sessionId="existing-session-id"
  apiKey="your-api-key"
/>

User Flow

  1. Entry: User selects onramp (buy) or offramp (sell)
  2. Configuration: Enter amount and confirm details
  3. Email Verification: Submit email and verify with OTP code
  4. KYC: Complete identity verification (one-time)
  5. Payment (Onramp): Get bank account details and make transfer
  6. Crypto Transfer (Offramp): Send crypto to provided address
  7. Completion: Receive confirmation and transaction details

Theming & Customization

The widget supports light and dark themes:

<PouchPayWidget
  // ... other props
  theme="dark"
/>

More customization options coming soon.

TypeScript Support

This package is written in TypeScript and includes full type definitions:

import type { PouchPayWidgetProps, SavedBankAccount } from '@pouchpay/widget';

const config: PouchPayWidgetProps = {
  walletAddress: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e',
  cryptoCurrency: 'USDT',
  cryptoNetwork: 'TRC20',
  apiKey: 'your-api-key'
};

Getting an API Key

  1. Visit https://dash.pouch.finance
  2. Register and verify your email
  3. Create a new API key in the dashboard
  4. Use the test key for development and live key for production

Requirements

  • React: 18.0.0 or higher (including React 19)
  • React DOM: 18.0.0 or higher (including React 19)
  • Next.js: Compatible with all versions (App Router and Pages Router)

Browser Support

  • Chrome (latest)
  • Firefox (latest)
  • Safari (latest)
  • Edge (latest)
  • Mobile browsers (iOS Safari, Chrome Mobile)

Examples

Check out the examples/ directory for complete working examples:

  • React with TypeScript
  • Next.js integration
  • Vanilla JavaScript
  • Vue.js integration

Troubleshooting

Widget not loading

Make sure you have React and ReactDOM loaded:

<script crossorigin src="https://unpkg.com/react@18/umd/react.production.min.js"></script>
<script crossorigin src="https://unpkg.com/react-dom@18/umd/react-dom.production.min.js"></script>

Container not found error

Ensure you have a container element with the correct ID:

<div id="pouchpay-widget"></div>

TypeScript errors

Make sure you have the latest type definitions:

npm install --save-dev @types/react @types/react-dom

Support

License

MIT © PouchPay

Contributing

Contributions are welcome! Please read our contributing guidelines before submitting a PR.

Security

If you discover a security vulnerability, please email [email protected] instead of using the issue tracker.


Made with ❤️ by the PouchPay team