@liquidcommerce/elements-sdk 2.7.41 → 2.7.43

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.
Files changed (54) hide show
  1. package/README.md +1 -0
  2. package/dist/index.checkout.esm.js +10032 -8227
  3. package/dist/index.esm.js +14956 -13180
  4. package/dist/ssr-stub.esm.js +6 -0
  5. package/dist/types/clients/base.d.ts +1 -0
  6. package/dist/types/clients/helpers.d.ts +2 -1
  7. package/dist/types/core/api/api-client.service.d.ts +9 -5
  8. package/dist/types/core/client/actions/client-address-action.service.d.ts +1 -1
  9. package/dist/types/core/pubsub/interfaces/checkout.interface.d.ts +15 -0
  10. package/dist/types/core/pubsub/interfaces/core.interface.d.ts +4 -1
  11. package/dist/types/core/store/interfaces/checkout.interface.d.ts +18 -1
  12. package/dist/types/core/store/interfaces/core.interface.d.ts +2 -2
  13. package/dist/types/enums/core.enum.d.ts +6 -0
  14. package/dist/types/index.checkout.d.ts +2 -1
  15. package/dist/types/interfaces/api/checkout.interface.d.ts +32 -0
  16. package/dist/types/interfaces/client.interface.d.ts +3 -1
  17. package/dist/types/interfaces/configs/checkout.interface.d.ts +1 -0
  18. package/dist/types/interfaces/injection.interface.d.ts +6 -0
  19. package/dist/types/modules/address/address-input.component.d.ts +1 -0
  20. package/dist/types/modules/address/address.command.d.ts +2 -2
  21. package/dist/types/modules/checkout/checkout.commands.d.ts +40 -3
  22. package/dist/types/modules/checkout/checkout.component.d.ts +1 -0
  23. package/dist/types/modules/checkout/components/checkout-buyer.component.d.ts +1 -0
  24. package/dist/types/modules/checkout/components/checkout-deliver-to.component.d.ts +1 -0
  25. package/dist/types/modules/checkout/components/checkout-delivery-method.component.d.ts +22 -0
  26. package/dist/types/modules/checkout/components/checkout-express-checkout.component.d.ts +60 -0
  27. package/dist/types/modules/checkout/components/checkout-express-completion.component.d.ts +21 -0
  28. package/dist/types/modules/checkout/components/checkout-place-order-button.component.d.ts +0 -6
  29. package/dist/types/modules/checkout/components/checkout-stripe-form.component.d.ts +0 -1
  30. package/dist/types/modules/checkout/components/checkout-stripe-handler.component.d.ts +4 -0
  31. package/dist/types/modules/checkout/components/index.d.ts +3 -0
  32. package/dist/types/modules/checkout/constant.d.ts +12 -0
  33. package/dist/types/modules/checkout/customer-prefill.d.ts +4 -1
  34. package/dist/types/modules/checkout/express-wallet.d.ts +12 -0
  35. package/dist/types/modules/checkout/stripe-js.d.ts +2 -0
  36. package/dist/types/modules/checkout/styles/delivery-method.style.d.ts +1 -0
  37. package/dist/types/modules/checkout/styles/express-checkout.style.d.ts +1 -0
  38. package/dist/types/modules/checkout/styles/express-completion.style.d.ts +1 -0
  39. package/dist/types/modules/ui-components/alert/alert.component.d.ts +10 -10
  40. package/dist/types/modules/ui-components/input/input.component.d.ts +1 -1
  41. package/dist/types/utils/format.d.ts +4 -0
  42. package/dist/types/utils/places-session-token.d.ts +1 -0
  43. package/docs/v1/api/actions/address-actions.md +5 -1
  44. package/docs/v1/api/actions/checkout-actions.md +3 -1
  45. package/docs/v1/api/client.md +49 -0
  46. package/docs/v1/api/configuration.md +3 -1
  47. package/docs/v1/api/typescript-types.md +10 -1
  48. package/docs/v1/guides/accessibility.md +32 -0
  49. package/docs/v1/guides/address-component.md +6 -0
  50. package/docs/v1/guides/checkout-component.md +121 -6
  51. package/docs/v1/guides/events.md +58 -0
  52. package/docs/v1/guides/theming.md +1 -0
  53. package/docs/v1/reference/analytics.md +14 -2
  54. package/package.json +7 -7
@@ -52,7 +52,17 @@ The SDK detects an already-present partner/host GTM container rather than replac
52
52
 
53
53
  ### Google tag gateway
54
54
 
55
- If your site loads its own GTM container first-party through [Google tag gateway for advertisers](https://developers.google.com/tag-platform/tag-manager/gateway/get-started) (e.g. `https://www.yoursite.com/metrics/` instead of `https://www.googletagmanager.com/gtm.js?id=GTM-XXXX`), tell the SDK where that path is so it recognizes your container:
55
+ [Google tag gateway for advertisers](https://developers.google.com/tag-platform/tag-manager/gateway/get-started) serves your Google tags from your own domain instead of Google's. Your GTM container loads from a first-party path such as `https://www.yoursite.com/metrics/` instead of `https://www.googletagmanager.com/gtm.js?id=GTM-XXXX`, and its measurement requests (e.g. GA4 `/g/collect` hits) go out through that same path. Your CDN or load balancer forwards them to Google, so they are less likely to be blocked than requests to Google's domains.
56
+
57
+ #### How the SDK works with it
58
+
59
+ - The SDK pushes every event to the page's `window.dataLayer`. Your container reads that same `dataLayer`, so it receives SDK events whether it loads from Google or from your gateway. Keep the default `dataLayer` name: a container renamed with `&l=` never sees them.
60
+ - The SDK never loads your container and proxies nothing. The LiquidCommerce container still loads from `googletagmanager.com`.
61
+ - To send SDK events to your own GA4 property, add a Custom Event trigger in your container on the [event names](#events) below and a GA4 Event tag that fires on it. The SDK puts `items`, `value` and `currency` at the top level of each event, not inside an `ecommerce` object, so map them with Data Layer Variables rather than the GA4 tag's "Send Ecommerce data" option.
62
+
63
+ #### `gatewayUrl`
64
+
65
+ Tell the SDK your gateway path so it can recognize your container:
56
66
 
57
67
  ```javascript
58
68
  const client = await Elements('YOUR_API_KEY', {
@@ -62,7 +72,9 @@ const client = await Elements('YOUR_API_KEY', {
62
72
 
63
73
  Or declaratively, on the script tag: `data-gtm-gateway-url="/metrics/"`.
64
74
 
65
- A gateway script URL usually carries no container ID, so without this setting the SDK cannot match the script tag to your partner container. A script with the same origin whose path starts with that value is matched to your partner container by container ID: an `id=` query parameter must equal your partner container ID, and a script without one counts only once GTM's `window.google_tag_manager` registry lists your container ID (or while no container has booted yet). A gateway serving a different container or a GA4/Ads tag is therefore never taken for yours. Relative values resolve against the current page. The setting affects detection only — the SDK never loads your container, and the LiquidCommerce container still loads from `googletagmanager.com`.
75
+ A gateway script URL usually carries no container ID, so until GTM has booted your container this setting is the only way the SDK can match the script tag to it. Once matched, your container ID is added to each event's `send_to` targets. The setting is optional: events reach your container through `dataLayer` without it.
76
+
77
+ A script with the same origin whose path starts with that value is matched to your partner container by container ID: an `id=` query parameter must equal your partner container ID, and a script without one counts only once GTM's `window.google_tag_manager` registry lists your container ID (or while no container has booted yet). A gateway serving a different container or a GA4/Ads tag is therefore never taken for yours. Relative values resolve against the current page.
66
78
 
67
79
  When both the LiquidCommerce container and a partner container are initialized, events are sent to both using GA4's `send_to` targeting (a dual-container send). Only containers that are actually initialized are added to `send_to`, so events are never routed to a container that failed to load.
68
80
 
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "LiquidCommerce Elements SDK",
4
4
  "license": "UNLICENSED",
5
5
  "author": "LiquidCommerce Team",
6
- "version": "2.7.41",
6
+ "version": "2.7.43",
7
7
  "homepage": "https://docs.liquidcommerce.co/elements-sdk",
8
8
  "repository": {
9
9
  "type": "git",
@@ -14,7 +14,7 @@
14
14
  },
15
15
  "module": "./dist/index.esm.js",
16
16
  "types": "./dist/types/index.d.ts",
17
- "packageManager": "pnpm@11.24.0",
17
+ "packageManager": "pnpm@12.9.1",
18
18
  "exports": {
19
19
  ".": {
20
20
  "types": "./dist/types/index.d.ts",
@@ -109,7 +109,7 @@
109
109
  "theming"
110
110
  ],
111
111
  "devDependencies": {
112
- "@biomejs/biome": "^2.5.14",
112
+ "@biomejs/biome": "^2.5.15",
113
113
  "@commitlint/cli": "^21.2.3",
114
114
  "@commitlint/config-conventional": "^21.2.3",
115
115
  "@playwright/test": "1.63.0",
@@ -126,18 +126,18 @@
126
126
  "@semantic-release/npm": "^13.2.0",
127
127
  "@semantic-release/release-notes-generator": "^14.1.1",
128
128
  "@types/core-js": "^2.5.8",
129
- "@types/node": "^26.6.3",
129
+ "@types/node": "^26.6.4",
130
130
  "conventional-changelog": "8.1.3",
131
131
  "husky": "^9.1.7",
132
- "jsdom": "30.1.1",
132
+ "jsdom": "30.1.2",
133
133
  "process": "^0.11.10",
134
- "rollup": "^4.63.5",
134
+ "rollup": "^4.64.0",
135
135
  "rollup-obfuscator": "^4.1.1",
136
136
  "rollup-plugin-typescript2": "^0.37.0",
137
137
  "semantic-release": "^25.0.9",
138
138
  "ts-node": "^10.9.2",
139
139
  "typescript": "6.0.3",
140
- "vitest": "5.0.2"
140
+ "vitest": "5.0.3"
141
141
  },
142
142
  "engines": {
143
143
  "node": ">=22"