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

@paydirectv2/react-widgets

v0.1.0

Published

Portable React widgets for the PayDirect API — drop-in PayDirectProvider + CheckoutWidget with zero CSS dependencies.

Readme

/react-widgets

Portable React widgets for the PayDirect API. Drop them into any React or Next.js app — no Tailwind, no shadcn/ui, no global CSS required.

Looking for the styled shadcn versions used inside the PayDirect dashboard? Copy them from components/widgets/ in the PayDirect repo.

Install

npm install @paydirectv2/react-widgets

Peer deps: react >= 17, react-dom >= 17.

Quick start

"use client"
import { PayDirectProvider, CheckoutWidget } from "@paydirectv2/react-widgets"

export function Checkout() {
  return (
    <PayDirectProvider apiKey={process.env.NEXT_PUBLIC_PAYDIRECT_API_KEY!}>
      <CheckoutWidget
        amount="10.00"
        description="Order #123"
        returnUrl="https://yourapp.com/orders/123/success"
        cancelUrl="https://yourapp.com/orders/123"
        onSuccess={(payment) => console.log(payment.paymentMethod, payment.id)}
        onError={(err) => console.error(err)}
      />
    </PayDirectProvider>
  )
}

PayDirectProvider props

| Prop | Type | Default | Description | | --------- | --------------------------------- | ----------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | | apiKey | string | — | Your PayDirect API key (pd_live_… or pd_test_…). | | baseUrl | string | "https://www.paydirect.com" | API base URL. Set to "" to call same-origin (useful when your Next.js app proxies the API). | | theme | "light" \| "dark" \| "auto" | "auto" | Theme hint exposed on data-paydirect-theme. The widget itself ships dark-on-dark by default; override via the style / className props on widgets. | | onError | (err: string) => void | — | Global error callback. |

CheckoutWidget props

| Prop | Type | Default | Description | | ---------------- | ------------------------------- | ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | | amount | string | — | Fixed payment amount. Leave blank with showAmountForm to let the customer enter their own. | | description | string | — | Description shown on the receipt and webhook. | | merchantWallet | string | — | Optional. Destination wallet override. If omitted, PayDirect uses the workspace's settlement_address (or your account-level fallback). | | metadata | Record<string, string> | — | Arbitrary metadata stored on the payment and echoed in webhooks. | | returnUrl | string | — | URL the customer is redirected to after a successful payment. | | cancelUrl | string | — | URL the customer is redirected to if they cancel. | | showAmountForm | boolean | true | Show amount input + token selector. Disable for fixed-amount checkouts. | | defaultToken | "USDC" \| "ETH" \| "ADAO" | "USDC" | Default crypto token to suggest. | | onSuccess | (payment) => void | — | Called when the payment is successfully created (not when it settles — listen to webhooks for that). | | onError | (error: string) => void | — | Failure callback. | | style | React.CSSProperties | — | Style overrides applied to the outer card. | | className | string | — | Class name applied to the outer card (composes after default inline styles). |

How does this differ from the in-repo widgets?

| Widget source | Styling | Use when | | ------------------------------------------------------- | ---------------------------------------- | --------------------------------------------------------------------- | | /react-widgets (this package) | Self-contained inline styles, no deps | You want a one-line install in any app | | components/widgets/ in the PayDirect monorepo | Tailwind + shadcn/ui + lucide-react | You have a Tailwind+shadcn project and want pixel-matched UI |

Both call the same POST /api/v1/payments endpoint and accept the same payment options — they are interchangeable from the API's perspective.

License

MIT