# @kaching.sh/react

> Headless React hooks for kaching carts, checkout and orders

Latest version **0.1.1** (published 2026-09-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install @kaching.sh/react
pnpm add @kaching.sh/react
yarn add @kaching.sh/react
bun add @kaching.sh/react
```

## Health

**Score 60/100 (C)** — status: active.

Positive: esm support; no vulnerabilities; recently updated; high maintenance score.

Warnings: low downloads; no types; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2026-09-24 |
| First published | 2026-09-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Node | >=20 |
| Dependencies | 1 |
| Unpacked size | 15.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | swnevin |
| Keywords | kaching, ecommerce, react, cart, checkout, hooks |

## Links

- npm: https://www.npmjs.com/package/@kaching.sh/react
- Repository: https://github.com/sventhaman/Kaching
- Homepage: https://kaching.sh
- Issues: https://github.com/sventhaman/Kaching/issues
- npm.io page: https://npm.io/package/@kaching.sh/react

## Dependencies (1)

- [@kaching.sh/sdk](https://npm.io/package/@kaching.sh/sdk.md) ^0.1.1

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.1.1 (latest) — 2026-09-24
- 0.1.0 — 2026-09-23

## README

# @kaching.sh/react

Headless React hooks for [kaching](https://kaching.sh) carts, checkout and order confirmation.

```tsx
"use client";
import { KachingProvider, useCart, formatMoney } from "@kaching.sh/react";

export function Providers({ children }) {
  return <KachingProvider publishableKey={process.env.NEXT_PUBLIC_KACHING_PUBLISHABLE_KEY!}>{children}</KachingProvider>;
}

function AddToCart({ variantId }) {
  const { addItem, pending } = useCart();
  return <button disabled={pending} onClick={() => addItem(variantId)}>Add to cart</button>;
}
```

- `useCart()` — `cart`, `addItem`, `updateItem`, `removeItem`, `checkout()` (redirects to Stripe),
  drawer state (`isOpen`, `open`, `close`). The cart persists across reloads.
- `useOrder(sessionId)` — on your success page; waits for the payment webhook, then returns the order
  (including download links) and clears the cart.

Fastest start: `npx kaching-cli create my-store` gives you a complete Next.js storefront built on these hooks.

---
_Source: https://npm.io/package/@kaching.sh/react · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
