@cartbase/storefront 0.1.0 → 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/LICENSE +21 -0
- package/README.md +58 -0
- package/package.json +2 -2
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Cartbase
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
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,8 +1,8 @@
|
|
|
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
|
-
"license": "
|
|
5
|
+
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "git+https://github.com/1click-so/barter.git",
|