@shoppexio/storefront 0.1.0 → 0.3.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.0
4
+
5
+ - Publish the active Storefront SDK runtime under `@shoppexio/storefront`.
6
+ - Include cart coupon validation types for `{ productId, variantId }`.
7
+
8
+ ## 0.1.1
9
+
10
+ - Package metadata and release polish.
11
+
3
12
  ## 0.1.0
4
13
 
5
14
  - first public storefront package release
package/README.md CHANGED
@@ -1,8 +1,12 @@
1
1
  # @shoppexio/storefront
2
2
 
3
- Public npm package for the Shoppex Storefront SDK.
3
+ Official JavaScript storefront SDK for Shoppex.
4
4
 
5
- This package is the storefront-facing SDK for:
5
+ Use this package when you want to embed Shoppex products, cart behavior, and hosted checkout into a custom frontend.
6
+
7
+ ## Good fit
8
+
9
+ Use this package for:
6
10
 
7
11
  - product loading
8
12
  - cart state
@@ -26,3 +30,25 @@ const products = await shoppex.getProducts();
26
30
  shoppex.addToCart(products.data?.[0]?.uniqid ?? '', 'default', 1);
27
31
  await shoppex.checkout();
28
32
  ```
33
+
34
+ ## Coupon validation
35
+
36
+ Use the options form when validating a coupon for a selected product variant:
37
+
38
+ ```ts
39
+ const result = await shoppex.validateCoupon('SAVE10', {
40
+ productId: 'prod_abc123',
41
+ variantId: 'variant_lifetime',
42
+ });
43
+ ```
44
+
45
+ Calling `validateCoupon(code)` without options validates against the current SDK cart. Affiliate/referral codes are separate and should use `validateAffiliateCode` or `applyAffiliateCode`.
46
+
47
+ ## Not this package
48
+
49
+ If you want the authenticated Developer API wrapper for backend integrations, use `@shoppexio/sdk`. Do not ship `@shoppexio/sdk` in a browser bundle; use this Storefront SDK for headless storefronts.
50
+
51
+ ## Docs
52
+
53
+ - Storefront docs: [docs.shoppex.io/sdk/introduction](https://docs.shoppex.io/sdk/introduction)
54
+ - Installation: [docs.shoppex.io/sdk/installation](https://docs.shoppex.io/sdk/installation)