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

@asap-crypto/react-sdk

v0.3.2

Published

The ASAP React SDK provides a streamlined way to integrate the ASAP crypto payment gateway into your React application. It offers a single, easy-to-use component (`<ASAP />`) that handles the entire payment flow within a self-contained modal, from transac

Downloads

60

Readme

ASAP React SDK

The ASAP React SDK provides a streamlined way to integrate the ASAP crypto payment gateway into your React application. It offers a single, easy-to-use component (<ASAP />) that handles the entire payment flow within a self-contained modal, from transaction review to wallet connection and status tracking.

Features

  • Simple Integration: Drop the <ASAP /> component into your app to get started.
  • Complete Payment Flow: A multi-step modal guides users through reviewing their payment, choosing a payment method, connecting their wallet, and viewing the transaction status.
  • Multiple Payment Options:
    • Pay with an ASAP account (Phone & PIN).
    • Pay with an external wallet (integrates with MetaMask, Trust Wallet, Coinbase Wallet, etc., via AppKit).
    • Pay by sending funds directly to a recipient's address.
  • Configurable and Flexible: Users can select from various supported chains (e.g., Base, Avalanche, Optimism) and currencies (e.g., USDC, ETH, USDT) directly within the modal.
  • Robust Wallet Connectivity: Built on top of wagmi and @reown/appkit for reliable wallet interactions.
  • Customizable Styling: Styled with Tailwind CSS for easy customization.

Installation

To install the SDK, run the following command in your project directory:

npm install @asap-crypto/react-sdk

or with yarn:

yarn add @asap-crypto/react-sdk

Peer Dependencies

This library requires react and react-dom as peer dependencies. Please ensure they are installed in your project.

"peerDependencies": {
  "react": "^19.1.1",
  "react-dom": "^19.1.1"
}

Usage

The SDK exports a single component, <ASAP />. It includes all necessary context providers and handles its own state. The component's CSS is automatically injected, so no separate CSS import is required.

Props

The <ASAP /> component accepts the following props:

  • secretKey (string, required): The secret key to be used for authorization, you have to create a business account with ASAP and retrieve the key on the merchant dashboard.
  • amount (number, required): The payment amount in the local currency.
  • currency (string, required): The currency code for the payment (e.g., "NGN" for Nigerian Naira).
  • bgColor (string, not required): The background color for the Pay with ASAP button.
  • textColor (string, not required): The text color for the Pay with ASAP button.

Here's a basic example of how to use it in your application:

import React from 'react';
import { ASAP, useASAP } from '@asap-crypto/react-sdk';

function MyPaymentPage() {
  {/* The useASAP hook which helps keep track of every transaction */}
  const { transaction } = useASAP();

  {/* The useASAP hook helps monitor the staus of a transaction */}
  if(transaction.status === "success") {
    alert("Transaction was successful");
  }

  return (
    <div style={{ 
      display: 'flex', 
      justifyContent: 'center', 
      alignItems: 'center', 
      height: '100vh' 
    }}>
      {/* The ASAP component renders a button that triggers the payment flow */}
      <ASAP secretKey={"xxxxx"} amount={10000} currency="NGN" bgColor="#fff" textColor="black" />
    </div>
  );
}

export default MyPaymentPage;

The Payment Flow

Clicking the "Pay with ASAP" button opens a modal that guides the user through the following steps:

  1. Review Payment: Users can review the payment amount in both crypto and local currency. They can also select their desired blockchain network and currency from a dropdown menu. A countdown timer shows how long the quoted rate is valid.

  2. Choose Payment Method: Users select how they want to pay:

    • Pay with ASAP: Prompts the user to log in with their phone number and PIN.
    • Pay with external wallet: Allows the user to connect a Web3 wallet.
    • Send directly to wallet: Displays the recipient's wallet address for a manual transfer.
  3. Connect & Authorize: Based on the choice above, the user will:

    • Enter their credentials for an ASAP account.
    • Connect their wallet using the integrated AppKit modal.
    • Copy the wallet address and QR code for a direct transfer.
  4. Transaction Status: The modal displays the real-time status of the transaction, including Processing, Pending, Successful, or Failed states, providing clear feedback to the user.

Local Development

To contribute to the development of the ASAP React SDK:

  1. Clone the repository:

    git clone https://github.com/benji042/asap-sdk-react.git
    cd asap-sdk-react
  2. Install dependencies:

    npm install
  3. Run the development server:

    npm run dev

    This will start a Vite development server and open a preview page (src/App.tsx) where you can test your changes to the SDK components in real-time.

  4. Build the library: To build the distributable files for the package, run:

    npm run build

    This command compiles the TypeScript code from the lib directory and outputs the final JavaScript and type definition files to the dist directory.