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

@pybara/donate-widget

v1.0.0-beta.13

Published

Embeddable donation widget for Internet Computer crypto payments — the ready-made form; for a custom form use @pybara/pybara-js

Downloads

1,424

Readme

Pybara Donate Widget

A donation widget for any website: visitors give in crypto on the Internet Computer, from their own wallet, and the donation is paid to yours. One script, no server, no WordPress needed.

Building your own form, or taking payments beyond donations? Use @pybara/pybara-js — Pybara.checkout() opens the same checkout surface over your UI. This package is the ready-made donation form.

Quick start

<div id="pybara-donate"></div>
<script src="https://cdn.jsdelivr.net/npm/@pybara/donate-widget@beta/dist/pybara-donate.iife.js"></script>
<script>
  PybaraDonate.init({
    target: '#pybara-donate',               // where the widget renders
    recipientPrincipal: 'xxxxx-xxxxx-...',  // your Pybara Wallet's principal
    siteUrl: 'https://example.com',         // your site's address
    siteName: 'Example Charity',            // the name donors see
  });
</script>

These four options are required; every other one is optional, with the defaults in Configuration.

@beta follows the latest beta. To stay on one version, use it instead, for example @1.0.0-beta.1.

ES module

In a bundled app (Vite, Next.js, …), install the package instead of the script tag:

npm install @pybara/donate-widget@beta
import { init } from '@pybara/donate-widget';

init({
  target: '#pybara-donate',
  recipientPrincipal: 'xxxxx-xxxxx-...',
  siteUrl: 'https://example.com',
  siteName: 'Example Charity',
});

The package also exports the DonationWidget class (what init returns), destroyAll(), and the config types — all typed.

Before it shows

The widget stays hidden until your site is set up in Pybara Wallet, under Manage › Sites › Add a site without a plugin:

  1. Your site's DNS record lists your wallet. This needs a domain of your own: a platform subdomain (*.replit.app and the like) cannot hold the record.
  2. You accept the Pybara Terms of Service for that site, in the same place.

Until then, and whenever Pybara pauses the widget, nothing is shown, and your browser's console says why. The checkout itself pays only a wallet your site's DNS record lists, whatever the page does.

Pricing

A single platform fee per donation: no monthly fees, no setup fees. The rate is a flat 1% for every site, fixed in the settlement canister's code, which is public and cannot change.

The fee also covers the network fees. Donors give the exact amount they choose, and you receive your full share: exactly 99% of every donation. The split is made on-chain by a publicly auditable canister whose code cannot change, and which applies the same 1% to every split.

The one exception is AutoStable: if you have a token converted to a stablecoin as it arrives, set in Pybara Wallet, the conversion's cost is deducted on top of the platform fee.

Configuration

Required

| Option | Type | Description | |--------|------|-------------| | target | string \| HTMLElement | CSS selector or element to render into | | recipientPrincipal | string | Your Pybara Wallet's principal, the one your DNS record lists | | siteUrl | string | Your site's address, e.g. https://example.com: the origin of the page the widget is on, or the checkout refuses the donation | | siteName | string | The name donors see |

Optional

| Option | Type | Default | Description | |--------|------|---------|-------------| | presetAmounts | number[] | suited to the currency | Up to 6 preset amounts, in the display currency, each above 0 — the checkout shows its own minimum. Default: about $5, $10, $25, $50 in round figures ([5, 10, 25, 50] in EUR, [1000, 2000, 5000, 10000] in JPY) | | allowCustom | boolean | true | Let donors enter their own amount | | allowRecurring | boolean | true | Offer recurring donations | | defaultFrequency | string | 'monthly' | 'weekly', 'monthly' or 'yearly' | | defaultDurationInMonths | number \| null | 12 | The recurring duration preselected: 3, 6, 12 or 24 months, or null for no end date; donors can change it | | tokens | string[] | All supported | Tokens donors may give, of those Pybara currently offers: 'ckUSDC', 'ckUSDT', 'ckBTC', 'ckETH', 'ICP' | | title | string | — | Shown above the amounts | | description | string | — | Shown below the title | | buttonLabel | string | Donate, in the widget's language | The button's label | | thankYouMessage | string | — | Replaces the success screen's title, which is otherwise shown in the donor's language | | donorMessage | string | — | Prefills the message field donors can write to you on the confirm screen — max 500 characters | | donorEmail | string | — | Prefills the receipt-address field on the confirm screen — donors who leave an email get a payment record once the donation settles | | wantsTaxReceipt | boolean | — | Pre-ticks the "I'd like a tax receipt" checkbox on the confirm screen — shown only when your site is linked to a nonprofit in Pybara Wallet; the donor's own choice is what counts | | thankYouRedirectUrl | string | — | Where to send donors afterwards | | primaryColor | string | '#7c3aed' | Accent colour (hex) | | theme | 'light' \| 'dark' \| 'auto' | 'light' | 'auto' follows your page's background and its theme switcher | | currency | string | 'USD' | Display currency (ISO 4217), e.g. 'EUR' | | locale | string | Browser's | Interface language: 'en', 'fr', 'de', 'es', 'it', 'pt', 'nl', 'pl', 'ro', 'ja', 'ko' or 'zh-CN' | | fontUrl | string | — | A .woff2 font of your own; none is loaded otherwise | | onSuccess | function | — | Called once the donation is made | | onError | function | — | Called on an error | | onClose | function | — | Called when the checkout is closed without donating | | staging | boolean | false | Use Pybara's staging environment, for testing | | debug | boolean | false | Log details to the console |

The same options are published as a JSON Schema at docs.pybara.com/donate-widget/options.schema.json — for editors and agents that validate a config before writing it. A copy ships in the package as options.schema.json, versioned with the code.

Example with options

PybaraDonate.init({
  target: '#pybara-donate',
  recipientPrincipal: 'xxxxx-xxxxx-...',
  siteUrl: 'https://example.com',
  siteName: 'Example Charity',
  primaryColor: '#e11d48',
  currency: 'EUR',
  locale: 'fr',
  presetAmounts: [5, 10, 25],
  tokens: ['ckUSDC', 'ICP'],
  buttonLabel: 'Soutenir',
});

Theming

  • light (default) and dark cards, or auto, which samples your page's background and follows your theme switcher and the visitor's system setting.
  • The accent colour is adjusted where needed so text stays readable on the card; buttons keep your exact colour.
  • A soft shadow lifts the card off your page. Already showing the widget inside a card of your own? Turn it off, or set your own, on the target element or any parent: #pybara-donate { --pybara-donate-shadow: none; }.
  • Your site's styles stay out: the card sets its own font, line height and text styles, so a reset such as div { line-height: 1 } doesn't reach inside it.

Languages

English, French, German, Spanish, Italian, Portuguese, Dutch, Polish, Romanian, Japanese, Korean and Chinese (simplified), chosen from the visitor's browser unless locale is set. The checkout follows the same language.

Error reports

When the checkout can't open, or fails once open, the widget tells Pybara through @pybara/pybara-js, so a problem can be fixed before you have to write in: the error's code and message, your site's address, the platform and plugin version, and whether it was a donation. Nothing about the donor, and no IP address is stored. Details: the "Error reports" section of @pybara/pybara-js's README.

Content Security Policy

On a site with a strict Content Security Policy, allow:

  • script-src: https://cdn.jsdelivr.net
  • frame-src: https://pybara.io, where donors pay
  • connect-src: https://icp-api.io and https://*.raw.icp0.io, for Pybara's settings, and https://py6mw-3yaaa-aaaas-amwhq-cai.icp0.io, for error reports
  • img-src: https://assets.pybara.com

Learn more

docs.pybara.com

License

MIT