@liquidcommerce/elements-sdk 2.6.0-beta.12 → 2.6.0-beta.121

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 (294) hide show
  1. package/README.md +100 -2518
  2. package/dist/index.checkout.esm.js +20445 -0
  3. package/dist/index.esm.js +28574 -20597
  4. package/dist/ssr-stub.checkout.esm.js +17 -0
  5. package/dist/ssr-stub.esm.js +277 -0
  6. package/dist/types/auto-initialize/checkout.d.ts +2 -0
  7. package/dist/types/auto-initialize/shared-utils.d.ts +51 -0
  8. package/dist/types/{elements-base-client.d.ts → clients/base.d.ts} +16 -2
  9. package/dist/types/clients/builder.d.ts +3 -0
  10. package/dist/types/clients/checkout.d.ts +6 -0
  11. package/dist/types/clients/helpers.d.ts +8 -0
  12. package/dist/types/clients/main.d.ts +3 -0
  13. package/dist/types/constants/core.constant.d.ts +13 -18
  14. package/dist/types/constants/index.d.ts +1 -0
  15. package/dist/types/constants/prop65.constant.d.ts +8 -0
  16. package/dist/types/core/a11y/announcer.service.d.ts +16 -0
  17. package/dist/types/core/a11y/focus-manager.service.d.ts +21 -0
  18. package/dist/types/core/a11y/focusable.d.ts +5 -0
  19. package/dist/types/core/a11y/glyph-button.d.ts +8 -0
  20. package/dist/types/core/a11y/index.d.ts +6 -0
  21. package/dist/types/core/a11y/required.d.ts +1 -0
  22. package/dist/types/core/a11y/single-select.d.ts +20 -0
  23. package/dist/types/core/api/api-client.service.d.ts +23 -18
  24. package/dist/types/core/api/api-result.d.ts +19 -0
  25. package/dist/types/core/api/auth-client.service.d.ts +37 -13
  26. package/dist/types/core/api/http-client.service.d.ts +0 -8
  27. package/dist/types/core/base-component.service.d.ts +4 -1
  28. package/dist/types/core/client/actions/base-action.service.d.ts +22 -0
  29. package/dist/types/core/client/actions/client-address-action.service.d.ts +18 -0
  30. package/dist/types/core/client/actions/client-cart-action.service.d.ts +38 -0
  31. package/dist/types/core/client/actions/client-checkout-action.service.d.ts +75 -0
  32. package/dist/types/core/client/actions/client-product-action.service.d.ts +15 -0
  33. package/dist/types/core/client/client-action.service.d.ts +6 -74
  34. package/dist/types/core/client/client-config.service.d.ts +10 -5
  35. package/dist/types/core/debug-panel/debug-panel.styles.d.ts +1 -1
  36. package/dist/types/core/google-tag-manager.service.d.ts +10 -1
  37. package/dist/types/core/logger/logger.service.d.ts +1 -1
  38. package/dist/types/core/pubsub/interfaces/address.interface.d.ts +3 -0
  39. package/dist/types/core/pubsub/interfaces/cart.interface.d.ts +6 -1
  40. package/dist/types/core/pubsub/interfaces/checkout.interface.d.ts +45 -49
  41. package/dist/types/core/pubsub/interfaces/core.interface.d.ts +15 -7
  42. package/dist/types/core/pubsub/pubsub.service.d.ts +1 -2
  43. package/dist/types/core/singleton-manager.service.d.ts +12 -8
  44. package/dist/types/core/store/interfaces/cart.interface.d.ts +2 -3
  45. package/dist/types/core/store/interfaces/checkout.interface.d.ts +36 -107
  46. package/dist/types/core/store/interfaces/core.interface.d.ts +12 -2
  47. package/dist/types/core/store/interfaces/metadata.interface.d.ts +11 -0
  48. package/dist/types/core/store/interfaces/product-list.interface.d.ts +30 -0
  49. package/dist/types/core/store/interfaces/product.interface.d.ts +1 -0
  50. package/dist/types/core/store/store.constant.d.ts +5 -0
  51. package/dist/types/core/store/store.service.d.ts +1 -0
  52. package/dist/types/core/telemetry/telemetry.service.d.ts +1 -0
  53. package/dist/types/enums/core.enum.d.ts +47 -2
  54. package/dist/types/enums/index.d.ts +0 -1
  55. package/dist/types/index.checkout.d.ts +9 -0
  56. package/dist/types/index.checkout.umd.d.ts +4 -0
  57. package/dist/types/index.d.ts +8 -3
  58. package/dist/types/interfaces/api/cart.interface.d.ts +12 -7
  59. package/dist/types/interfaces/api/checkout.interface.d.ts +271 -0
  60. package/dist/types/interfaces/api/index.d.ts +5 -0
  61. package/dist/types/interfaces/api/product-list.interface.d.ts +15 -6
  62. package/dist/types/interfaces/api/product.interface.d.ts +10 -4
  63. package/dist/types/interfaces/client.interface.d.ts +74 -0
  64. package/dist/types/interfaces/component.interface.d.ts +7 -0
  65. package/dist/types/interfaces/config.interface.d.ts +44 -0
  66. package/dist/types/interfaces/configs/address.interface.d.ts +1 -1
  67. package/dist/types/interfaces/configs/cart.interface.d.ts +2 -1
  68. package/dist/types/interfaces/configs/checkout.interface.d.ts +3 -1
  69. package/dist/types/interfaces/configs/global.interface.d.ts +9 -3
  70. package/dist/types/interfaces/configs/index.d.ts +1 -0
  71. package/dist/types/interfaces/configs/product-list.interface.d.ts +49 -0
  72. package/dist/types/interfaces/configs/product.interface.d.ts +7 -1
  73. package/dist/types/interfaces/injection.interface.d.ts +56 -0
  74. package/dist/types/modules/address/address-display.component.d.ts +3 -1
  75. package/dist/types/modules/address/address-input.component.d.ts +10 -1
  76. package/dist/types/modules/address/address.command.d.ts +2 -1
  77. package/dist/types/modules/address/styles/register-styles.d.ts +1 -0
  78. package/dist/types/modules/cart/cart.commands.d.ts +9 -5
  79. package/dist/types/modules/cart/components/cart-body.component.d.ts +1 -0
  80. package/dist/types/modules/cart/components/cart-fulfillment.component.d.ts +1 -1
  81. package/dist/types/modules/cart/components/cart-item-quantity-price.component.d.ts +5 -0
  82. package/dist/types/modules/cart/components/cart-item.component.d.ts +6 -0
  83. package/dist/types/modules/cart/styles/register-styles.d.ts +1 -0
  84. package/dist/types/modules/checkout/checkout.commands.d.ts +95 -12
  85. package/dist/types/modules/checkout/checkout.component.d.ts +7 -1
  86. package/dist/types/modules/checkout/components/checkout-billing.component.d.ts +5 -2
  87. package/dist/types/modules/checkout/components/checkout-buyer.component.d.ts +1 -0
  88. package/dist/types/modules/checkout/components/checkout-completed.component.d.ts +5 -0
  89. package/dist/types/modules/checkout/components/checkout-deliver-to.component.d.ts +1 -0
  90. package/dist/types/modules/checkout/components/checkout-delivery-method.component.d.ts +22 -0
  91. package/dist/types/modules/checkout/components/checkout-express-checkout.component.d.ts +61 -0
  92. package/dist/types/modules/checkout/components/checkout-express-completion.component.d.ts +21 -0
  93. package/dist/types/modules/checkout/components/checkout-header.component.d.ts +1 -0
  94. package/dist/types/modules/checkout/components/checkout-item-quantity.component.d.ts +4 -0
  95. package/dist/types/modules/checkout/components/checkout-items.component.d.ts +4 -3
  96. package/dist/types/modules/checkout/components/checkout-order-summary.component.d.ts +3 -0
  97. package/dist/types/modules/checkout/components/checkout-payment.component.d.ts +6 -1
  98. package/dist/types/modules/checkout/components/checkout-place-order-button.component.d.ts +1 -5
  99. package/dist/types/modules/checkout/components/checkout-presale-countdown.component.d.ts +15 -1
  100. package/dist/types/modules/checkout/components/checkout-presale-expired.component.d.ts +7 -1
  101. package/dist/types/modules/checkout/components/checkout-prop65-warning.component.d.ts +8 -0
  102. package/dist/types/modules/checkout/components/checkout-send-as-gift.component.d.ts +3 -0
  103. package/dist/types/modules/checkout/components/checkout-stripe-form.component.d.ts +7 -2
  104. package/dist/types/modules/checkout/components/checkout-tips.component.d.ts +4 -2
  105. package/dist/types/modules/checkout/components/index.d.ts +4 -0
  106. package/dist/types/modules/checkout/components/promo-pc-gc.component.d.ts +0 -2
  107. package/dist/types/modules/checkout/components/required-fields-legend.d.ts +1 -0
  108. package/dist/types/modules/checkout/constant.d.ts +15 -0
  109. package/dist/types/modules/checkout/customer-prefill.d.ts +5 -0
  110. package/dist/types/modules/checkout/express-wallet.d.ts +12 -0
  111. package/dist/types/modules/checkout/payment-session-error.d.ts +4 -0
  112. package/dist/types/modules/checkout/styles/delivery-method.style.d.ts +1 -0
  113. package/dist/types/modules/checkout/styles/express-checkout.style.d.ts +1 -0
  114. package/dist/types/modules/checkout/styles/express-completion.style.d.ts +1 -0
  115. package/dist/types/modules/checkout/styles/register-styles.d.ts +1 -0
  116. package/dist/types/modules/product/components/components.d.ts +26 -2
  117. package/dist/types/modules/product/components/index.d.ts +1 -0
  118. package/dist/types/modules/product/components/product-add-to-cart-section.component.d.ts +8 -1
  119. package/dist/types/modules/product/components/product-delivery-estimate.component.d.ts +11 -0
  120. package/dist/types/modules/product/components/product-description.component.d.ts +1 -0
  121. package/dist/types/modules/product/components/product-drawer.component.d.ts +6 -0
  122. package/dist/types/modules/product/components/product-image-carousel.component.d.ts +5 -0
  123. package/dist/types/modules/product/components/product-options.component.d.ts +2 -1
  124. package/dist/types/modules/product/components/product-prop65-warning.d.ts +1 -0
  125. package/dist/types/modules/product/components/product-retailers-carousel.component.d.ts +6 -0
  126. package/dist/types/modules/product/components/product-retailers-popup-list.component.d.ts +12 -2
  127. package/dist/types/modules/product/components/product-retailers-popup.component.d.ts +1 -0
  128. package/dist/types/modules/product/components/product-retailers.component.d.ts +1 -0
  129. package/dist/types/modules/product/product.commands.d.ts +5 -5
  130. package/dist/types/modules/product/product.component.d.ts +3 -0
  131. package/dist/types/modules/product/styles/prop65-warning.style.d.ts +1 -0
  132. package/dist/types/modules/product/styles/register-styles.d.ts +1 -0
  133. package/dist/types/modules/product-list/components/card-components/index.d.ts +6 -0
  134. package/dist/types/modules/product-list/components/card-components/product-badge.d.ts +9 -0
  135. package/dist/types/modules/product-list/components/card-components/product-button.d.ts +11 -0
  136. package/dist/types/modules/product-list/components/card-components/product-fulfillment-text.d.ts +2 -0
  137. package/dist/types/modules/product-list/components/card-components/product-price-and-personalization.d.ts +14 -0
  138. package/dist/types/modules/product-list/components/card-components/product-quantity-selector.d.ts +11 -0
  139. package/dist/types/modules/product-list/components/card-components/product-sizes-list.d.ts +14 -0
  140. package/dist/types/modules/product-list/components/filter-components/index.d.ts +7 -0
  141. package/dist/types/modules/product-list/components/filter-components/product-list-apply-filter-button.d.ts +1 -0
  142. package/dist/types/modules/product-list/components/{product-list-filters-subcomponents/product-list-checkbox-filter.components.d.ts → filter-components/product-list-checkbox-filter.d.ts} +1 -0
  143. package/dist/types/modules/product-list/components/filter-components/product-list-chip.d.ts +5 -0
  144. package/dist/types/modules/product-list/components/filter-components/product-list-filters-chips.d.ts +13 -0
  145. package/dist/types/modules/product-list/components/filter-components/product-list-fulfillment-filter.d.ts +15 -0
  146. package/dist/types/modules/product-list/components/{product-list-filters-subcomponents/product-list-price-filter.components.d.ts → filter-components/product-list-price-filter.d.ts} +2 -1
  147. package/dist/types/modules/product-list/components/filter-components/product-list-toggle-filters.d.ts +7 -0
  148. package/dist/types/modules/product-list/components/index.d.ts +6 -2
  149. package/dist/types/modules/product-list/components/product-list-card-loading.component.d.ts +3 -1
  150. package/dist/types/modules/product-list/components/product-list-card.component.d.ts +39 -31
  151. package/dist/types/modules/product-list/components/product-list-engraving.component.d.ts +12 -0
  152. package/dist/types/modules/product-list/components/product-list-filters.component.d.ts +58 -36
  153. package/dist/types/modules/product-list/components/product-list-product-engraving-lines.component.d.ts +22 -0
  154. package/dist/types/modules/product-list/components/product-list-product-pre-cart.component.d.ts +54 -0
  155. package/dist/types/modules/product-list/components/product-list-search.component.d.ts +25 -0
  156. package/dist/types/modules/product-list/product-list-filter.registry.d.ts +42 -0
  157. package/dist/types/modules/product-list/product-list-filter.utils.d.ts +7 -0
  158. package/dist/types/modules/product-list/product-list-order.utils.d.ts +3 -0
  159. package/dist/types/modules/product-list/product-list-query-params.utils.d.ts +3 -0
  160. package/dist/types/modules/product-list/product-list.commands.d.ts +22 -7
  161. package/dist/types/modules/product-list/product-list.component.d.ts +23 -47
  162. package/dist/types/modules/product-list/product-list.constants.d.ts +38 -0
  163. package/dist/types/modules/product-list/product-list.interface.d.ts +17 -28
  164. package/dist/types/modules/product-list/styles/product-list-card.style.d.ts +1 -0
  165. package/dist/types/modules/product-list/styles/product-list-filters.style.d.ts +1 -0
  166. package/dist/types/modules/product-list/styles/register-styles.d.ts +1 -0
  167. package/dist/types/modules/theme-provider/constants/component-groupings.d.ts +1 -0
  168. package/dist/types/modules/theme-provider/constants/css-variable-mappings.d.ts +1 -1
  169. package/dist/types/modules/theme-provider/services/style-registry.service.d.ts +16 -0
  170. package/dist/types/modules/theme-provider/services/stylesheet-generator.service.d.ts +0 -1
  171. package/dist/types/modules/theme-provider/styles/register-styles.d.ts +1 -0
  172. package/dist/types/modules/theme-provider/theme-provider.service.d.ts +2 -2
  173. package/dist/types/modules/ui-components/alert/alert.component.d.ts +10 -10
  174. package/dist/types/modules/ui-components/buttons/buttons-open-cart.component.d.ts +5 -0
  175. package/dist/types/modules/ui-components/drawer/drawer.component.d.ts +15 -0
  176. package/dist/types/modules/ui-components/engraving/engraving-form.component.d.ts +9 -1
  177. package/dist/types/modules/ui-components/engraving/engraving-view.component.d.ts +7 -1
  178. package/dist/types/modules/ui-components/input/index.d.ts +0 -1
  179. package/dist/types/modules/ui-components/input/input.component.d.ts +15 -2
  180. package/dist/types/modules/ui-components/lce-element/lce-element.component.d.ts +2 -1
  181. package/dist/types/modules/ui-components/promo-code-ticker/promo-code-ticker.component.d.ts +1 -1
  182. package/dist/types/modules/ui-components/ui.commands.d.ts +7 -1
  183. package/dist/types/ssr/stub.checkout.d.ts +6 -0
  184. package/dist/types/ssr/stub.d.ts +10 -0
  185. package/dist/types/static/icon/arrow-right.icon.d.ts +1 -1
  186. package/dist/types/static/icon/bag.icon.d.ts +1 -1
  187. package/dist/types/static/icon/check.icon.d.ts +2 -0
  188. package/dist/types/static/icon/checkbox.icon.d.ts +1 -1
  189. package/dist/types/static/icon/chevron-down.icon.d.ts +1 -1
  190. package/dist/types/static/icon/chevron-left.icon.d.ts +1 -1
  191. package/dist/types/static/icon/chevron-up.icon.d.ts +1 -1
  192. package/dist/types/static/icon/close.icon.d.ts +1 -1
  193. package/dist/types/static/icon/error-info.icon.d.ts +1 -1
  194. package/dist/types/static/icon/filter.icon.d.ts +1 -1
  195. package/dist/types/static/icon/icon.a11y.d.ts +1 -0
  196. package/dist/types/static/icon/icon.types.d.ts +1 -0
  197. package/dist/types/static/icon/index.d.ts +2 -0
  198. package/dist/types/static/icon/info.icon.d.ts +1 -1
  199. package/dist/types/static/icon/loading-spinner.icon.d.ts +1 -1
  200. package/dist/types/static/icon/search.icon.d.ts +1 -1
  201. package/dist/types/static/icon/success.icon.d.ts +1 -1
  202. package/dist/types/static/icon/trash.icon.d.ts +1 -1
  203. package/dist/types/static/icon/warning.icon.d.ts +1 -1
  204. package/dist/types/utils/dom-compat.d.ts +2 -0
  205. package/dist/types/utils/format.d.ts +9 -14
  206. package/dist/types/utils/image-bg-removal.d.ts +3 -0
  207. package/dist/types/utils/product-selection.d.ts +16 -0
  208. package/dist/types/utils/product.d.ts +21 -0
  209. package/dist/types/utils/timezone.d.ts +6 -0
  210. package/docs/v1/README.md +213 -0
  211. package/docs/v1/api/actions/address-actions.md +286 -0
  212. package/docs/v1/api/actions/cart-actions.md +364 -0
  213. package/docs/v1/api/actions/checkout-actions.md +586 -0
  214. package/docs/v1/api/actions/product-actions.md +204 -0
  215. package/docs/v1/api/client.md +664 -0
  216. package/docs/v1/api/configuration.md +583 -0
  217. package/docs/v1/api/injection-methods.md +331 -0
  218. package/docs/v1/api/typescript-types.md +501 -0
  219. package/docs/v1/api/ui-helpers.md +200 -0
  220. package/docs/v1/examples/advanced-patterns.md +199 -0
  221. package/docs/v1/examples/checkout-flow.md +90 -0
  222. package/docs/v1/examples/custom-theming.md +76 -0
  223. package/docs/v1/examples/multi-product-page.md +90 -0
  224. package/docs/v1/examples/simple-product-page.md +89 -0
  225. package/docs/v1/getting-started/concepts.md +521 -0
  226. package/docs/v1/getting-started/installation.md +351 -0
  227. package/docs/v1/getting-started/quick-start.md +410 -0
  228. package/docs/v1/guides/accessibility.md +288 -0
  229. package/docs/v1/guides/address-component.md +435 -0
  230. package/docs/v1/guides/best-practices.md +365 -0
  231. package/docs/v1/guides/cart-component.md +800 -0
  232. package/docs/v1/guides/checkout-component.md +817 -0
  233. package/docs/v1/guides/events.md +1004 -0
  234. package/docs/v1/guides/product-component.md +761 -0
  235. package/docs/v1/guides/product-list-component.md +730 -0
  236. package/docs/v1/guides/theming.md +243 -0
  237. package/docs/v1/integration/angular.md +39 -0
  238. package/docs/v1/integration/laravel.md +41 -0
  239. package/docs/v1/integration/nextjs.md +69 -0
  240. package/docs/v1/integration/proxy-setup.md +106 -0
  241. package/docs/v1/integration/react.md +64 -0
  242. package/docs/v1/integration/vanilla-js.md +84 -0
  243. package/docs/v1/integration/vue.md +58 -0
  244. package/docs/v1/reference/analytics.md +133 -0
  245. package/docs/v1/reference/browser-support.md +47 -0
  246. package/docs/v1/reference/error-handling.md +83 -0
  247. package/docs/v1/reference/performance.md +52 -0
  248. package/docs/v1/reference/telemetry.md +85 -0
  249. package/docs/v1/reference/troubleshooting.md +135 -0
  250. package/package.json +75 -45
  251. package/dist/types/elements-builder-client.d.ts +0 -2
  252. package/dist/types/elements-client-helper.d.ts +0 -4
  253. package/dist/types/elements-client.d.ts +0 -2
  254. package/dist/types/enums/cloud.enum.d.ts +0 -97
  255. package/dist/types/interfaces/cloud/checkout.interface.d.ts +0 -218
  256. package/dist/types/interfaces/cloud/core.interface.d.ts +0 -22
  257. package/dist/types/interfaces/cloud/index.d.ts +0 -3
  258. package/dist/types/interfaces/cloud/retailer.interface.d.ts +0 -67
  259. package/dist/types/interfaces/cloud/user.interface.d.ts +0 -100
  260. package/dist/types/interfaces/core.interface.d.ts +0 -111
  261. package/dist/types/modules/checkout/components/checkout.type.d.ts +0 -4
  262. package/dist/types/modules/product-list/components/product-list-filters-subcomponents/index.d.ts +0 -6
  263. package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-apply-filter-button.component.d.ts +0 -1
  264. package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-delivery-options-filter.components.d.ts +0 -16
  265. package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-search.component.d.ts +0 -16
  266. package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-toggle-filters.components.d.ts +0 -18
  267. package/dist/types/modules/theme-provider/styles/address/index.d.ts +0 -1
  268. package/dist/types/modules/theme-provider/styles/cart/index.d.ts +0 -1
  269. package/dist/types/modules/theme-provider/styles/checkout/index.d.ts +0 -1
  270. package/dist/types/modules/theme-provider/styles/product/index.d.ts +0 -3
  271. package/dist/types/modules/theme-provider/styles/product-list/index.d.ts +0 -1
  272. package/dist/types/modules/theme-provider/styles/ui/index.d.ts +0 -3
  273. package/dist/types/modules/ui-components/input/birthdate-input.component.d.ts +0 -53
  274. package/dist/types/utils/helper.d.ts +0 -28
  275. package/docs/ACTIONS.md +0 -1300
  276. package/docs/BROWSER_SUPPORT.md +0 -279
  277. package/docs/CONFIGURATION.md +0 -853
  278. package/docs/DOCUMENTATION_INDEX.md +0 -311
  279. package/docs/EVENTS.md +0 -798
  280. package/docs/PROXY.md +0 -228
  281. package/docs/THEMING.md +0 -592
  282. package/docs/TROUBLESHOOTING.md +0 -793
  283. package/umd/elements.js +0 -1
  284. /package/dist/types/{auto-initialize.d.ts → auto-initialize/main.d.ts} +0 -0
  285. /package/dist/types/modules/{theme-provider/styles/address → address/styles}/address.style.d.ts +0 -0
  286. /package/dist/types/modules/{theme-provider/styles/cart → cart/styles}/cart.style.d.ts +0 -0
  287. /package/dist/types/modules/{theme-provider/styles/checkout → checkout/styles}/checkout.style.d.ts +0 -0
  288. /package/dist/types/modules/{theme-provider/styles/product → product/styles}/image-carousel.style.d.ts +0 -0
  289. /package/dist/types/modules/{theme-provider/styles/product → product/styles}/product.style.d.ts +0 -0
  290. /package/dist/types/modules/{theme-provider/styles/product → product/styles}/retailers.style.d.ts +0 -0
  291. /package/dist/types/modules/{theme-provider/styles/product-list → product-list/styles}/product-list.style.d.ts +0 -0
  292. /package/dist/types/modules/{theme-provider/styles/ui → ui-components/styles}/drawer.style.d.ts +0 -0
  293. /package/dist/types/modules/{theme-provider/styles/ui → ui-components/styles}/loading.style.d.ts +0 -0
  294. /package/dist/types/modules/{theme-provider/styles/ui → ui-components/styles}/promo-code-ticker.style.d.ts +0 -0
@@ -0,0 +1,351 @@
1
+ # Installation
2
+
3
+ The LiquidCommerce Elements SDK can be integrated into your website using either a CDN script tag or as an NPM package.
4
+
5
+ ## Browser Requirements
6
+
7
+ The SDK requires:
8
+ - Modern browser with Web Components support (Chrome 66+, Firefox 60+, Safari 12+, Edge 79+)
9
+ - Shadow DOM support
10
+ - JavaScript enabled
11
+
12
+ For older browsers, you'll need to include Web Components and Shadow DOM polyfills.
13
+
14
+ ## CDN Installation (Recommended)
15
+
16
+ The simplest way to get started is by adding the SDK script tag to your HTML.
17
+
18
+ ### Basic Setup
19
+
20
+ Add the following script tag to your page's `<head>` section:
21
+
22
+ ```html
23
+ <script
24
+ defer
25
+ data-liquid-commerce-elements
26
+ data-token="YOUR_API_KEY"
27
+ data-env="production"
28
+ type="text/javascript"
29
+ src="https://elements.reservebar-worker.workers.dev/all/elements.js"
30
+ ></script>
31
+ ```
32
+
33
+ > **Note:** The host `elements.reservebar-worker.workers.dev` shown above is an example, partner-specific endpoint. Use the CDN URL provided by your LiquidCommerce representative in place of this host.
34
+
35
+ The path segment selects which bundle is served:
36
+
37
+ | Path | Bundle |
38
+ |------|--------|
39
+ | `/all/elements.js` | Full SDK bundle (product, cart, checkout, and all other elements) |
40
+ | `/checkout/checkout.js` | Checkout-only bundle (tree-shaken, smaller) |
41
+ | `/all/beta/elements.js` | Beta channel of the full SDK bundle |
42
+
43
+ ### Script Attributes
44
+
45
+ | Attribute | Required | Description |
46
+ |-----------|----------|-------------|
47
+ | `data-liquid-commerce-elements` | Yes | Identifies this as the Elements SDK script |
48
+ | `data-token` | Yes | Your LiquidCommerce API key |
49
+ | `data-env` | No | Environment: `staging` or `production`. Defaults to `production` if omitted. |
50
+ | `data-gtm-gateway-url` | No | Google tag gateway path your own GTM container is served from (e.g. `/metrics/`). See [Analytics → Google tag gateway](../reference/analytics.md#google-tag-gateway). |
51
+ | `defer` | Recommended | Allows non-blocking script loading |
52
+
53
+ ### Where to Place the Script
54
+
55
+ While the `<head>` section is recommended, the script can be placed anywhere on your page:
56
+
57
+ ```html
58
+ <!DOCTYPE html>
59
+ <html>
60
+ <head>
61
+ <title>My Store</title>
62
+ <!-- SDK script in head (recommended) -->
63
+ <script
64
+ defer
65
+ data-liquid-commerce-elements
66
+ data-token="YOUR_API_KEY"
67
+ data-env="production"
68
+ type="text/javascript"
69
+ src="https://elements.reservebar-worker.workers.dev/all/elements.js"
70
+ ></script>
71
+ </head>
72
+ <body>
73
+ <!-- Your content -->
74
+ </body>
75
+ </html>
76
+ ```
77
+
78
+ The `defer` attribute ensures the script loads asynchronously without blocking page content, keeping your site fast regardless of placement.
79
+
80
+ ### Checkout-Only Build
81
+
82
+ If you only need checkout functionality (without product displays or cart), use the lighter checkout-only build:
83
+
84
+ ```html
85
+ <script
86
+ defer
87
+ data-liquid-commerce-elements
88
+ data-token="YOUR_API_KEY"
89
+ data-env="production"
90
+ type="text/javascript"
91
+ src="https://elements.reservebar-worker.workers.dev/checkout/checkout.js"
92
+ ></script>
93
+ ```
94
+
95
+ This build is tree-shaken and significantly smaller, ideal for dedicated checkout pages.
96
+
97
+ ## NPM Installation
98
+
99
+ For JavaScript/TypeScript projects using a bundler (Webpack, Rollup, Vite, etc.), install via NPM:
100
+
101
+ ```bash
102
+ npm install @liquidcommerce/elements-sdk
103
+ ```
104
+
105
+ ### Basic Usage
106
+
107
+ ```javascript
108
+ import { Elements } from '@liquidcommerce/elements-sdk';
109
+
110
+ // Initialize the client
111
+ const client = await Elements('YOUR_API_KEY', {
112
+ env: 'production'
113
+ });
114
+
115
+ // Client is ready to use
116
+ console.log('Elements SDK initialized');
117
+ ```
118
+
119
+ ### Checkout-Only Import
120
+
121
+ For tree-shaking benefits in checkout-only scenarios:
122
+
123
+ ```javascript
124
+ import { ElementsCheckout } from '@liquidcommerce/elements-sdk/checkout';
125
+
126
+ const client = await ElementsCheckout('YOUR_API_KEY', {
127
+ env: 'production'
128
+ });
129
+ ```
130
+
131
+ ### TypeScript Support
132
+
133
+ The SDK includes full TypeScript definitions. Import types as needed:
134
+
135
+ ```typescript
136
+ import { Elements } from '@liquidcommerce/elements-sdk';
137
+ import type {
138
+ ILiquidCommerceElementsClient,
139
+ ILiquidCommerceElementsConfig,
140
+ IInjectProductElement
141
+ } from '@liquidcommerce/elements-sdk';
142
+
143
+ const config: ILiquidCommerceElementsConfig = {
144
+ env: 'production',
145
+ customTheme: {
146
+ global: {
147
+ theme: {
148
+ primaryColor: '#007bff'
149
+ }
150
+ }
151
+ }
152
+ };
153
+
154
+ // Elements() returns `null` in SSR / non-browser environments, so the
155
+ // client is typed as `ILiquidCommerceElementsClient | null`.
156
+ const client: ILiquidCommerceElementsClient | null = await Elements('YOUR_API_KEY', config);
157
+
158
+ if (client) {
159
+ // Safe to use the client here
160
+ client.injectProductElement([
161
+ { containerId: 'product-1', identifier: '00619947000020' }
162
+ ]);
163
+ }
164
+ ```
165
+
166
+ ## Framework Integration
167
+
168
+ ### React
169
+
170
+ ```jsx
171
+ import { Elements } from '@liquidcommerce/elements-sdk';
172
+ import { useEffect, useState } from 'react';
173
+
174
+ function App() {
175
+ const [elementsClient, setElementsClient] = useState(null);
176
+
177
+ useEffect(() => {
178
+ async function initElements() {
179
+ const client = await Elements('YOUR_API_KEY', {
180
+ env: 'production'
181
+ });
182
+ setElementsClient(client);
183
+ }
184
+
185
+ initElements();
186
+ }, []);
187
+
188
+ useEffect(() => {
189
+ if (elementsClient) {
190
+ elementsClient.injectProductElement([
191
+ { containerId: 'product-1', identifier: '00619947000020' }
192
+ ]);
193
+ }
194
+ }, [elementsClient]);
195
+
196
+ return (
197
+ <div>
198
+ <div id="product-1"></div>
199
+ </div>
200
+ );
201
+ }
202
+ ```
203
+
204
+ ### Vue
205
+
206
+ ```vue
207
+ <template>
208
+ <div id="product-1"></div>
209
+ </template>
210
+
211
+ <script>
212
+ import { Elements } from '@liquidcommerce/elements-sdk';
213
+
214
+ export default {
215
+ async mounted() {
216
+ const client = await Elements('YOUR_API_KEY', {
217
+ env: 'production'
218
+ });
219
+
220
+ await client.injectProductElement([
221
+ { containerId: 'product-1', identifier: '00619947000020' }
222
+ ]);
223
+ }
224
+ }
225
+ </script>
226
+ ```
227
+
228
+ ### Next.js
229
+
230
+ In Next.js, initialize the SDK in a client component:
231
+
232
+ ```jsx
233
+ 'use client';
234
+
235
+ import { Elements } from '@liquidcommerce/elements-sdk';
236
+ import { useEffect } from 'react';
237
+
238
+ export default function ProductPage() {
239
+ useEffect(() => {
240
+ async function init() {
241
+ const client = await Elements('YOUR_API_KEY', {
242
+ env: 'production',
243
+ proxy: {
244
+ baseUrl: '/api/elements-proxy'
245
+ }
246
+ });
247
+
248
+ await client.injectProductElement([
249
+ { containerId: 'product', identifier: '00619947000020' }
250
+ ]);
251
+ }
252
+
253
+ init();
254
+ }, []);
255
+
256
+ return <div id="product"></div>;
257
+ }
258
+ ```
259
+
260
+ > **Note:** The SDK is SSR-safe. When imported in a Node.js / SSR environment, a lightweight stub is resolved automatically — factory functions return `null` and no browser APIs are accessed. Initialize on the client (e.g., `useEffect`, `onMounted`) to get the real client.
261
+
262
+ ## Configuration Options
263
+
264
+ The SDK accepts a configuration object during initialization:
265
+
266
+ ```javascript
267
+ const client = await Elements('YOUR_API_KEY', {
268
+ env: 'production', // Optional (defaults to 'production'): 'staging' | 'production'
269
+ debugMode: 'console', // Optional: 'none' | 'console' | 'panel'
270
+ customTheme: { /* ... */ }, // Optional: Theme customization
271
+ promoTicker: [ /* ... */ ], // Optional: Promo ticker configuration
272
+ proxy: { /* ... */ }, // Optional: Proxy configuration
273
+ gtm: { /* ... */ }, // Optional: Google tag gateway URL of your own GTM container
274
+ checkout: { /* ... */ }, // Optional: Checkout configuration
275
+ development: { /* ... */ } // Optional: Development/testing options
276
+ });
277
+ ```
278
+
279
+ > **Note:** `debugMode` is ignored when `env` is `'production'`. Debug logging and the debug panel are only activated outside production (`staging`).
280
+
281
+ See [Configuration Reference](../api/configuration.md) for complete configuration options.
282
+
283
+ ## Verification
284
+
285
+ After installation, verify the SDK is loaded correctly:
286
+
287
+ ### CDN Verification
288
+
289
+ Open your browser's console and check for:
290
+
291
+ ```javascript
292
+ // The client is available globally
293
+ console.log(window.LiquidCommerce.elements);
294
+ // Should output: { injectProductElement: ƒ, ui: {...}, actions: {...}, ... }
295
+ ```
296
+
297
+ ### NPM Verification
298
+
299
+ ```javascript
300
+ const client = await Elements('YOUR_API_KEY', { env: 'production' });
301
+ console.log(client); // Should output the client object
302
+ ```
303
+
304
+ ## Troubleshooting Installation
305
+
306
+ ### Script Not Loading
307
+
308
+ If the SDK script fails to load:
309
+
310
+ 1. **Check the network tab** in browser DevTools for 404 or CORS errors
311
+ 2. **Verify the script URL** is correct and accessible
312
+ 3. **Check ad blockers** - they may block scripts with "commerce" in the name (see [Proxy Setup](../integration/proxy-setup.md))
313
+
314
+ ### Web Components Not Supported
315
+
316
+ If you see an error about Web Components:
317
+
318
+ ```
319
+ [LiquidCommerce Elements] SDK requires support for Web Components. Please include a Web Components polyfill for older browsers.
320
+ ```
321
+
322
+ Include a Web Components polyfill before the SDK script:
323
+
324
+ ```html
325
+ <script src="https://cdn.jsdelivr.net/npm/@webcomponents/webcomponentsjs@2/webcomponents-bundle.js"></script>
326
+ <script defer data-liquid-commerce-elements ...></script>
327
+ ```
328
+
329
+ ### TypeScript Errors
330
+
331
+ If you encounter TypeScript errors:
332
+
333
+ 1. Ensure TypeScript version is 4.5 or higher
334
+ 2. Check that `@liquidcommerce/elements-sdk` is in your `dependencies` (not `devDependencies`)
335
+ 3. Verify your `tsconfig.json` includes:
336
+
337
+ ```json
338
+ {
339
+ "compilerOptions": {
340
+ "moduleResolution": "node",
341
+ "esModuleInterop": true
342
+ }
343
+ }
344
+ ```
345
+
346
+ ## Next Steps
347
+
348
+ - **Quick Start**: [Build your first product page in 5 minutes](./quick-start.md)
349
+ - **Core Concepts**: [Understand how the SDK works](./concepts.md)
350
+ - **Component Guides**: [Product](../guides/product-component.md), [Cart](../guides/cart-component.md), [Checkout](../guides/checkout-component.md)
351
+ - **API Reference**: [Full API documentation](../api/client.md)