@mitcheman/bodega
v0.3.1
Published
Bodega SDK — commerce storefront + merchant admin + auth + route handlers for Next.js App Router stores. The code powering the mitcheman/bodega Claude Code plugin.
Downloads
473
Maintainers
Readme
@mitcheman/bodega
Commerce components for Bodega stores. Framework-agnostic React library, themeable via CSS custom properties so it matches whatever design the site already has.
Install
npm install @mitcheman/bodegaAlso peer-required: react, react-dom, and a Next.js 16 app (for now —
other frameworks in Phase 2).
Surface
import {
ProductGrid,
ProductPage,
Cart,
Checkout,
CartProvider,
useCart,
} from '@mitcheman/bodega';<ProductGrid />
Renders all published products in a grid. Reads from Bodega's storage layer. Themed via design tokens (see below).
<ProductPage />
Single-product detail view. Takes slug from the route params.
<Cart />
Full cart page. <CartProvider> must wrap the app for cart state.
<Checkout />
Stripe Elements-based checkout. Requires STRIPE_PUBLISHABLE_KEY as an
environment variable (set by bodega:hosting and bodega:payments).
Theming
Every component respects these CSS custom properties, defined in your
app/bodega-theme.css (generated by bodega:deploy):
:root {
--bodega-bg: /* background */;
--bodega-fg: /* foreground text */;
--bodega-accent: /* CTA, links */;
--bodega-muted: /* secondary text, borders */;
--bodega-font-display: /* headings, product titles */;
--bodega-font-body: /* paragraph, labels */;
}Token resolution priority (handled by bodega:deploy):
.impeccable.mdparsed tokensapp/globals.csscustom propertiestailwind.config.*theme.extend.colors- Defaults (neutral warm palette)
Preview mode
All components accept a mode="preview" prop. In preview mode:
- "Add to cart" buttons become "Notify me when available"
- Checkout route shows "Store opening soon — drop your email"
- Cart is non-functional (redirect to notify-me)
This lets the site go live before Stripe KYC is complete.
Storage
Products and orders live in Vercel Blob via the Bodega API routes
(app/api/bodega/[...path]/route.ts). The SDK doesn't talk directly to
Blob — it goes through the API. This keeps tenant isolation clean when
we add the hosted tier later.
License
Apache 2.0.
