@shoppexio/storefront 0.1.1 → 0.3.1
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 +10 -0
- package/README.md +14 -1
- package/dist/index.cjs +8993 -276
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +270 -20
- package/dist/index.d.ts +270 -20
- package/dist/index.js +9001 -282
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.3.1
|
|
4
|
+
|
|
5
|
+
- Add `program_enabled` to affiliate validation responses.
|
|
6
|
+
- Clarify disabled affiliate program handling for headless storefronts.
|
|
7
|
+
|
|
8
|
+
## 0.3.0
|
|
9
|
+
|
|
10
|
+
- Publish the active Storefront SDK runtime under `@shoppexio/storefront`.
|
|
11
|
+
- Include cart coupon validation types for `{ productId, variantId }`.
|
|
12
|
+
|
|
3
13
|
## 0.1.1
|
|
4
14
|
|
|
5
15
|
- Package metadata and release polish.
|
package/README.md
CHANGED
|
@@ -31,9 +31,22 @@ shoppex.addToCart(products.data?.[0]?.uniqid ?? '', 'default', 1);
|
|
|
31
31
|
await shoppex.checkout();
|
|
32
32
|
```
|
|
33
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`. If `program_enabled` is false in an affiliate validation response, the shop-level affiliate program is disabled even if individual links exist.
|
|
46
|
+
|
|
34
47
|
## Not this package
|
|
35
48
|
|
|
36
|
-
If you want the authenticated Developer API wrapper for backend integrations, use `@shoppexio/sdk`.
|
|
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.
|
|
37
50
|
|
|
38
51
|
## Docs
|
|
39
52
|
|