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

bitcoin-serverless-donations

v1.0.22

Published

Accept private, on-chain Bitcoin payments with no database, no middlemen, and no server maintenance. Payments go directly to your own wallet.

Readme

Bitcoin Serverless Donations

Accept private, on-chain Bitcoin payments with no database, no middlemen, and no server maintenance. Payments go directly to your own wallet.

This repository contains both the serverless backend and an npm package for the frontend.

Bitcoin Serverless Donations widget

Quick Start

Backend

One click deployment to Netlify - just set your environment variables and you're ready to go.

Deploy to Netlify

Frontend

Add the CDN script and stylesheet, then call BitcoinPay.render():

<link
  rel="stylesheet"
  href="https://cdn.jsdelivr.net/npm/bitcoin-serverless-donations@latest/dist/bitcoin-pay.min.css"
/>
<script src="https://cdn.jsdelivr.net/npm/bitcoin-serverless-donations@latest/dist/bitcoin-pay.min.js"></script>

<div id="bitcoin-donate"></div>

<script>
  BitcoinPay.render({
    endpoint: "https://your-site.netlify.app/.netlify/functions/get-address",
    selector: "#bitcoin-donate",
    bitcoinFallbackAddress: "bc1q...",
    lightningAddress: "[email protected]",
  }).catch((error) => {
    console.error("Failed to render Bitcoin widget:", error);
  });
</script>

For a complete walkthrough, see the tutorial on my blog. Until Silent Payments gain widespread adoption, address rotation remains a solid approach to maintaining privacy when accepting donations.

Backend Setup

  1. Clone and install

    git clone https://github.com/bennet-org/bitcoin-serverless-donations.git
    cd bitcoin-serverless-donations
    npm install
  2. Set your environment variables in .env:

    BITCOIN_XPUB="xpub6..."
    BITCOIN_DERIVATION_PATH="m/84'/0'/0'"
  3. Test locally — verify that derived addresses match your wallet software

    npm run dev
  4. Deploy to Netlify and set both environment variables in your deployment settings. Your endpoint will be at:

    /.netlify/functions/get-address

Derivation Paths

| Standard | Path | Address format | XPUB prefix | | ---------------------- | ------------- | ------------------------ | ----------- | | BIP86 (P2TR) | m/86'/0'/0' | Taproot, bc1p... | xpub | | BIP84 (P2WPKH) | m/84'/0'/0' | Native SegWit, bc1q... | zpub | | BIP49 (P2WPKH-in-P2SH) | m/49'/0'/0' | Nested SegWit, 3... | ypub | | BIP44 (P2PKH) | m/44'/0'/0' | Legacy, 1... | xpub |

Your XPUB should be from the account level (e.g., m/84'/0'/0'). The function derives receiving addresses (/0/index) from there. Make sure values are enclosed in quotes, e.g. BITCOIN_DERIVATION_PATH="m/84'/0'/0'".

Always verify that your first few generated addresses match your wallet software. This is critical to ensure you can actually receive funds.

For implementation details and cache management, see TECHNICAL.md.

Frontend Setup

Loading the library

The Quick Start example above uses the CDN. Alternatively, install via npm for use with a bundler:

npm install bitcoin-serverless-donations
import { BitcoinPay } from "bitcoin-serverless-donations";
import "bitcoin-serverless-donations/css";

Options

BitcoinPay.render() accepts the following:

| Option | Description | | ------------------------ | ---------------------------------------------------------------------------------- | | selector | CSS selector for the target element(s), e.g. #bitcoin-donate | | endpoint | Full URL of your backend function | | bitcoinFallbackAddress | Address to use if the backend is unavailable | | bitcoinDonateText | Custom text above the Bitcoin address field | | lightningAddress | Lightning address for dual Bitcoin/Lightning mode | | lightningDonateText | Custom text above the Lightning address field |

You can render multiple widgets by using a class selector (e.g. .donation-widget) or by calling BitcoinPay.render() multiple times. See bitcoin-pay.js for the full API.

Styling

Customise the widget with CSS custom properties. Dark mode is supported automatically via prefers-color-scheme.

.bitcoin-pay-widget {
  --btc-pay-primary: #2563eb;
  --btc-pay-primary-hover: #1d4ed8;
  --btc-pay-border-radius: 4px;
}

See bitcoin-pay.css for all available variables.

Contributing

Pull requests welcome. Please make sure tests pass before submitting.

License

MIT — see LICENSE.