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

@nozle-js/react

v0.7.1

Published

Browser-safe React components for Nozle's public plan catalog and merchant-controlled checkout.

Readme

@nozle-js/react

Browser-safe React components for Nozle's public plan catalog and merchant-controlled checkout.

Credential boundary

  • pk_ is used only for GET /api/v1/plans.
  • Secret keys stay on the merchant backend.
  • The React package does not fetch customer billing, invoice, subscription, entitlement, or credit data.
  • The React package never sends a customer ID.

Install

npm install @nozle-js/react react react-dom @stripe/stripe-js @stripe/react-stripe-js

Merchant-backed checkout

import { BillingProvider, PricingTable } from "@nozle-js/react";

export function BillingPage({ csrfToken }: { csrfToken: string }) {
  return (
    <BillingProvider
      publishableKey={import.meta.env.VITE_NOZLE_PUBLISHABLE_KEY}
      createCheckout={async ({ planCode, returnUrl }) => {
        const response = await fetch("/api/billing/checkout", {
          method: "POST",
          credentials: "include",
          headers: {
            "Content-Type": "application/json",
            "X-CSRF-Token": csrfToken,
          },
          body: JSON.stringify({ planCode, returnUrl }),
        });

        if (!response.ok) throw new Error("Checkout failed");
        return response.json();
      }}
    >
      <PricingTable returnUrl={window.location.href} highlightPlan="pro" />
    </BillingProvider>
  );
}

The merchant endpoint authenticates the user, derives the Nozle customer from the authenticated user or team, validates the plan and HTTPS return URL, and calls Nozle with a restricted server-side sk_. Any browser-supplied customer identifier must be ignored or rejected.

createCheckout may return a hosted URL, an embedded Stripe client secret, type: "completed", or type: "scheduled". Paid plans activate only after Nozle processes verified Stripe success; a browser redirect is not proof of payment.

Components

  • PricingTable and usePlans read the public catalog with the publishable key.
  • CheckoutButton, UpgradeButton, UpgradeModal, and the default PricingTable CTA call the merchant's createCheckout callback.
  • Checkout renders Stripe hosted/embedded checkout results supplied by the merchant.
  • Gates, usage displays, PlanBadge, and PaymentMethodDisplay are presentational and consume caller-supplied data.

Customer billing, invoices, cancellation, top-ups, subscriptions, entitlements, and credits belong behind authenticated merchant endpoints. Never put an sk_, master key, or internal credential in browser code.