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

@bitbnpl/react

v0.1.0

Published

React SDK for BitBNPL - Bitcoin-backed Buy Now Pay Later

Readme

@bitbnpl/react

React SDK for BitBNPL - Bitcoin-backed Buy Now Pay Later

Installation

npm install @bitbnpl/react
# or
yarn add @bitbnpl/react
# or
pnpm add @bitbnpl/react

Quick Start

import { BitBNPLButton } from '@bitbnpl/react'

function ProductPage() {
  return (
    <div>
      <h1>Premium Headphones - $299.99</h1>

      <BitBNPLButton
        merchantAddress="0xYourMerchantAddress"
        amount={299.99}
        itemName="Premium Headphones"
        itemId="prod_headphones_001"
        itemImage="🎧"
        merchantName="Your Store"
      />
    </div>
  )
}

Props

| Prop | Type | Required | Description | |------|------|----------|-------------| | merchantAddress | string | ✅ | Your verified merchant address on BitBNPL | | amount | number \| string | ✅ | Product price in MUSD | | itemName | string | ✅ | Product name | | itemId | string | ❌ | Unique product identifier | | itemImage | string | ❌ | Product emoji/icon (default: 🛍️) | | merchantName | string | ❌ | Your store name | | children | ReactNode | ❌ | Custom button text (default: "Pay with BitBNPL") | | style | CSSProperties | ❌ | Custom inline styles | | className | string | ❌ | Custom CSS class | | baseUrl | string | ❌ | BitBNPL base URL (default: https://bitbnpl.com) | | onRedirect | () => void | ❌ | Callback when redirect starts | | onError | (error: Error) => void | ❌ | Error callback | | disabled | boolean | ❌ | Disable the button |

Examples

Basic Usage

<BitBNPLButton
  merchantAddress="0x1234..."
  amount={99.99}
  itemName="T-Shirt"
/>

Custom Styling

<BitBNPLButton
  merchantAddress="0x1234..."
  amount={199.99}
  itemName="Sneakers"
  style={{
    background: 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)',
    borderRadius: '12px',
    padding: '16px 32px',
  }}
>
  Buy Now - Pay Later
</BitBNPLButton>

With Callbacks

<BitBNPLButton
  merchantAddress="0x1234..."
  amount={499.99}
  itemName="Gaming Console"
  onRedirect={() => {
    console.log('User is being redirected to checkout')
    // Track analytics, show loading, etc.
  }}
  onError={(error) => {
    console.error('Checkout error:', error)
    alert('Failed to initiate checkout')
  }}
/>

Dynamic Amount

function ProductCard({ product }) {
  return (
    <div>
      <h2>{product.name}</h2>
      <p>${product.price}</p>

      <BitBNPLButton
        merchantAddress="0x1234..."
        amount={product.price}
        itemName={product.name}
        itemId={product.id}
        itemImage={product.emoji}
      />
    </div>
  )
}

TypeScript

This package includes TypeScript definitions. Import types like this:

import { BitBNPLButton, BitBNPLButtonProps } from '@bitbnpl/react'

const MyButton: React.FC<BitBNPLButtonProps> = (props) => {
  return <BitBNPLButton {...props} />
}

How It Works

  1. Button Click: User clicks the BitBNPL payment button
  2. Data Storage: Product details are stored in sessionStorage
  3. Redirect: User is redirected to BitBNPL checkout page
  4. Checkout: User connects wallet and completes purchase with installment options

Requirements

  • React 18.0.0 or higher
  • Merchant must be verified on BitBNPL platform

Getting Verified

To use BitBNPL as a merchant:

  1. Visit https://bitbnpl.com/merchant/register
  2. Register your business
  3. Wait for verification (24-48 hours)
  4. Use your merchant address in the SDK

Support

License

MIT © BitBNPL