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

mdk-cloudflare-react

v0.1.2

Published

Hosted checkout React UI for mdk-cloudflare on Cloudflare Workers

Readme

mdk-cloudflare-react

Hosted checkout React UI for mdk-cloudflare.

This package gives you a ready-made buyer flow on top of the backend package's /api/mdk route:

  • home page
  • checkout page
  • success page
  • browser helpers for create_checkout, get_checkout, confirm_checkout, and list_products
  • shared CSS for the hosted flow

Use it when you already have a Cloudflare Worker serving mdk-cloudflare and you want hosted checkout pages without rebuilding the buyer flow from scratch.

Documentation:

  • Repo README: https://github.com/johncantrell97/mdk-cloudflare/blob/main/README.md
  • React integration docs: https://github.com/johncantrell97/mdk-cloudflare/blob/main/HOSTED_CHECKOUT_SETUP.md
  • Architecture guide: https://github.com/johncantrell97/mdk-cloudflare/blob/main/ARCHITECTURE.md
  • Full setup guide: https://github.com/johncantrell97/mdk-cloudflare/blob/main/HOSTED_CHECKOUT_SETUP.md
  • Source examples: https://github.com/johncantrell97/mdk-cloudflare/tree/main/examples

Install

npm install mdk-cloudflare mdk-cloudflare-react

Peer support:

  • react: ^18.2.0 || ^19.0.0
  • react-dom: ^18.2.0 || ^19.0.0

Requirement

Your Worker must already expose /api/mdk using createUnifiedHandler() from mdk-cloudflare.

Plain React / Vite SPA

import 'mdk-cloudflare-react/styles.css'
import { HostedCheckoutStandaloneApp } from 'mdk-cloudflare-react'

export function App() {
  return <HostedCheckoutStandaloneApp />
}

If the flow should live under a subpath like /checkout, use:

<HostedCheckoutStandaloneApp basePath="/checkout" />

React Router

import 'mdk-cloudflare-react/styles.css'
import { HostedCheckoutFlow } from 'mdk-cloudflare-react'
import { Route, Routes, useLocation, useNavigate } from 'react-router-dom'

function CheckoutRoute() {
  const location = useLocation()
  const navigate = useNavigate()

  return (
    <HostedCheckoutFlow
      pathname={location.pathname}
      search={location.search}
      navigate={navigate}
      basePath="/checkout"
    />
  )
}

export function App() {
  return (
    <Routes>
      <Route path="/checkout/*" element={<CheckoutRoute />} />
    </Routes>
  )
}

Main Exports

import 'mdk-cloudflare-react/styles.css'
import {
  HostedCheckoutFlow,
  HostedCheckoutStandaloneApp,
  HostedCheckoutHomePage,
  HostedCheckoutPage,
  HostedCheckoutSuccessPage,
} from 'mdk-cloudflare-react'

The higher-level entry points are:

  • HostedCheckoutStandaloneApp for simple SPAs
  • HostedCheckoutFlow for apps that already own routing

basePath is optional and supports mounts like /checkout/* or /pay/*.

Reference Apps

  • React + Vite hosted checkout: https://github.com/johncantrell97/mdk-cloudflare/tree/main/examples/react-vite-worker
  • React Router hosted checkout: https://github.com/johncantrell97/mdk-cloudflare/tree/main/examples/react-router-worker