@cartbase/storefront 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +58 -0
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# @cartbase/storefront
|
|
2
|
+
|
|
3
|
+
The storefront kit for the [Cartbase](https://cartbase.net) commerce
|
|
4
|
+
platform: a fully-typed API client for every store endpoint, checkout
|
|
5
|
+
orchestration, a production-grade cart drawer, product and catalog
|
|
6
|
+
components, and consent-gated tracking — everything a storefront needs
|
|
7
|
+
between your pages and your store.
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm create cartbase my-store # scaffold with everything prewired
|
|
11
|
+
# or add to an existing Next.js app:
|
|
12
|
+
npm install @cartbase/storefront
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Setup
|
|
16
|
+
|
|
17
|
+
The package is **source-shipped TypeScript** — tell Next.js to compile it:
|
|
18
|
+
|
|
19
|
+
```js
|
|
20
|
+
// next.config.js
|
|
21
|
+
module.exports = {
|
|
22
|
+
transpilePackages: ["@cartbase/storefront"],
|
|
23
|
+
}
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Three environment values wire it to your store (all in your Cartbase
|
|
27
|
+
admin under **Settings**):
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
NEXT_PUBLIC_BARTER_URL= # your store's API origin
|
|
31
|
+
NEXT_PUBLIC_BARTER_CLIENT_ID= # your store's client id
|
|
32
|
+
NEXT_PUBLIC_BARTER_PUBLISHABLE_KEY= # optional, channel-scoped catalogs
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## What's inside
|
|
36
|
+
|
|
37
|
+
| Import | What you get |
|
|
38
|
+
|---|---|
|
|
39
|
+
| `@cartbase/storefront/api` | Typed client for the whole store API — products, carts, checkout, orders, customers, auth, content, search, reviews |
|
|
40
|
+
| `@cartbase/storefront/checkout` | The complete checkout: orchestration hook, address forms, shipping/payment method lists, Stripe wrapper, carrier pickers |
|
|
41
|
+
| `@cartbase/storefront/cart-drawer` | Slide-out cart with upsells, tiers, gift options, notes |
|
|
42
|
+
| `@cartbase/storefront/products` | PDP building blocks: gallery, options, prices, actions |
|
|
43
|
+
| `@cartbase/storefront/store` | Listing pages: pagination, sorting, collection/category/search templates |
|
|
44
|
+
| `@cartbase/storefront/order` | Order confirmation surfaces |
|
|
45
|
+
| `@cartbase/storefront/tracking` | Consent banner + consent-gated Meta Pixel / GA4 / analytics |
|
|
46
|
+
| `@cartbase/storefront/tailwind-preset` | The design tokens (Tailwind 3 preset) |
|
|
47
|
+
|
|
48
|
+
## Documentation
|
|
49
|
+
|
|
50
|
+
The complete reference — every endpoint with request/response shapes and
|
|
51
|
+
working examples, plus a step-by-step build runbook — is written to be
|
|
52
|
+
followed by a developer **or handed to a coding agent as-is**. It ships
|
|
53
|
+
inside every `npm create cartbase` scaffold under `docs/`, and online at
|
|
54
|
+
your store's docs site. Start with *Build a storefront — the runbook*.
|
|
55
|
+
|
|
56
|
+
## License
|
|
57
|
+
|
|
58
|
+
MIT © Cartbase
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cartbase/storefront",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Storefront SDK + UI component library for Cartbase stores: typed API client, checkout orchestration, cart drawer, product/catalog components, tracking. Source-shipped TypeScript — add it to transpilePackages.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|