@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,664 @@
1
+ # Client API
2
+
3
+ The Elements client is the main interface for interacting with the SDK. It provides methods for injecting components, managing UI elements, and performing actions.
4
+
5
+ ## Initialization
6
+
7
+ ### Elements()
8
+
9
+ Initialize the full SDK client.
10
+
11
+ ```typescript
12
+ function Elements(
13
+ apiKey: string,
14
+ config?: ILiquidCommerceElementsConfig
15
+ ): Promise<ILiquidCommerceElementsClient | null>
16
+ ```
17
+
18
+ **Parameters:**
19
+
20
+ | Parameter | Type | Required | Description |
21
+ |-----------|-------------------------------|----------|-----------------------------|
22
+ | `apiKey` | string | Yes | Your LiquidCommerce API key |
23
+ | `config` | ILiquidCommerceElementsConfig | No | Configuration object |
24
+
25
+ **Returns:** Promise that resolves to the client instance, or `null` if initialization fails.
26
+
27
+ **Example:**
28
+
29
+ ```javascript
30
+ import { Elements } from '@liquidcommerce/elements-sdk';
31
+
32
+ const client = await Elements('YOUR_API_KEY', {
33
+ env: 'production',
34
+ debugMode: 'console',
35
+ customTheme: { /* theme config */ }
36
+ });
37
+ ```
38
+
39
+ ### ElementsCheckout()
40
+
41
+ Initialize the checkout-only client (tree-shaken build).
42
+
43
+ ```typescript
44
+ function ElementsCheckout(
45
+ apiKey: string,
46
+ config?: ILiquidCommerceElementsCheckoutClientConfig
47
+ ): Promise<IElementsCheckoutClient | null>
48
+ ```
49
+
50
+ **Parameters:**
51
+
52
+ | Parameter | Type | Required | Description |
53
+ |-----------|---------------------------------------------|----------|-----------------------------|
54
+ | `apiKey` | string | Yes | Your LiquidCommerce API key |
55
+ | `config` | ILiquidCommerceElementsCheckoutClientConfig | No | Checkout configuration |
56
+
57
+ **Example:**
58
+
59
+ ```javascript
60
+ import { ElementsCheckout } from '@liquidcommerce/elements-sdk/checkout';
61
+
62
+ const client = await ElementsCheckout('YOUR_API_KEY', {
63
+ env: 'production'
64
+ });
65
+ ```
66
+
67
+ The checkout-only client exposes `injectCheckout()`, `injectExpressCheckout()`, `actions.checkout`
68
+ and `destroy()`.
69
+
70
+ #### injectExpressCheckout()
71
+
72
+ Injects only the Apple Pay and Google Pay wallet buttons, anywhere on the page, without the rest of
73
+ the checkout UI. Confirming the wallet sheet places the order outright — the wallet's contact and
74
+ billing details are sent to the checkout, so the shopper never fills a checkout form.
75
+
76
+ ```typescript
77
+ injectExpressCheckout(params: IInjectExpressCheckoutParams): Promise<IInjectedComponent | null>
78
+ ```
79
+
80
+ | Parameter | Type | Required | Description |
81
+ |-----------|------|----------|-------------|
82
+ | `containerId` | string | Yes | ID of an element that already exists in the DOM |
83
+ | `checkoutId` | string | No | Checkout token to bind the buttons to. Omit to use the checkout already loaded |
84
+ | `variant` | `'buttons' \| 'section'` | No | `'buttons'` (default) is the wallet row alone; `'section'` adds the "Express Checkout" heading and OR divider |
85
+
86
+ A checkout is prepared at injection time rather than when a button is tapped: Stripe gives the
87
+ wallet's click handler one second to open its sheet, which is not enough time to create a checkout
88
+ and a payment session. Without a `checkoutId` the checkout already in the store is reused, so the
89
+ buttons can be injected beside a checkout the page has already loaded; the checkout-only client has
90
+ no cart to fall back on, so it throws when there is no loaded checkout to attach to. Inject again
91
+ with a new token whenever the address or fulfillment changes — the amounts the sheet shows come from
92
+ the checkout the buttons were prepared against.
93
+
94
+ The buttons only render where the shopper's platform offers a wallet, and the block hides itself
95
+ entirely otherwise. Subscribe to `lce:actions.checkout_express_checkout_availability` to know which
96
+ state you are in. Both wallets require an HTTPS origin on a domain registered with Stripe, each
97
+ subdomain separately — see the
98
+ [checkout component guide](../guides/checkout-component.md#express-checkout-apple-pay-and-google-pay).
99
+
100
+ ```javascript
101
+ await client.injectExpressCheckout({
102
+ containerId: 'express-checkout-container'
103
+ });
104
+ ```
105
+
106
+ The full client exposes the same component as `injectExpressCheckoutElement()`, with the same
107
+ parameters. It differs in one way: with no `checkoutId` and no checkout loaded, it prepares one from
108
+ the current cart rather than throwing.
109
+
110
+ ```javascript
111
+ await client.injectExpressCheckoutElement({
112
+ containerId: 'pdp-express-checkout'
113
+ });
114
+ ```
115
+
116
+ ### ElementsBuilder()
117
+
118
+ Initialize the builder client, which exposes manual `inject*` / `update*` methods for fully programmatic composition.
119
+
120
+ ```typescript
121
+ function ElementsBuilder(
122
+ apiKey: string,
123
+ config?: ILiquidCommerceElementsBuilderConfig
124
+ ): Promise<ILiquidCommerceElementsBuilderClient | null>
125
+ ```
126
+
127
+ **Parameters:**
128
+
129
+ | Parameter | Type | Required | Description |
130
+ |-----------|--------------------------------------|----------|-----------------------------|
131
+ | `apiKey` | string | Yes | Your LiquidCommerce API key |
132
+ | `config` | ILiquidCommerceElementsBuilderConfig | No | Builder configuration object (same shape as `ILiquidCommerceElementsConfig`) |
133
+
134
+ **Returns:** Promise that resolves to the builder client instance (`ILiquidCommerceElementsBuilderClient`), or `null` if initialization fails or it is called outside the browser.
135
+
136
+ **Example:**
137
+
138
+ ```javascript
139
+ import { ElementsBuilder } from '@liquidcommerce/elements-sdk';
140
+
141
+ const builder = await ElementsBuilder('YOUR_API_KEY', {
142
+ env: 'production'
143
+ });
144
+ ```
145
+
146
+ ## Configuration
147
+
148
+ ### ILiquidCommerceElementsConfig
149
+
150
+ Complete configuration interface for the full SDK.
151
+
152
+ ```typescript
153
+ interface ILiquidCommerceElementsConfig {
154
+ // Optional
155
+ env?: ElementsEnv; // defaults to 'production' ('staging' | 'production')
156
+ debugMode?: DebugMode; // 'none' | 'console' | 'panel'
157
+ customTheme?: IClientCustomThemeConfig;
158
+ promoTicker?: IPromoTicker[];
159
+ proxy?: IElementsProxyConfig;
160
+ gtm?: IElementsGTMConfig;
161
+ checkout?: ILiquidCommerceElementsCheckoutConfig;
162
+ development?: ILiquidCommerceElementsDevelopmentConfig;
163
+ }
164
+ ```
165
+
166
+ #### Environment
167
+
168
+ ```typescript
169
+ type ElementsEnv = 'staging' | 'production';
170
+ ```
171
+
172
+ Determines which API environment to use.
173
+
174
+ #### Debug Mode
175
+
176
+ ```typescript
177
+ type DebugMode = 'none' | 'console' | 'panel';
178
+ ```
179
+
180
+ - `'none'`: No debug output (production default)
181
+ - `'console'`: Log debug info to browser console
182
+ - `'panel'`: Show debug panel on page
183
+
184
+ #### Custom Theme
185
+
186
+ ```typescript
187
+ interface IClientCustomThemeConfig {
188
+ global?: UpdateComponentGlobalConfigs;
189
+ product?: UpdateProductComponent;
190
+ address?: UpdateAddressComponent;
191
+ cart?: UpdateCartComponent;
192
+ checkout?: UpdateCheckoutComponent;
193
+ productList?: UpdateProductListComponent;
194
+ }
195
+ ```
196
+
197
+ See [Configuration Reference](./configuration.md) for detailed theme options.
198
+
199
+ #### Promo Ticker
200
+
201
+ ```typescript
202
+ interface IPromoTicker {
203
+ promoCode: string;
204
+ text: string[];
205
+ separator: string;
206
+ activeFrom: string; // ISO 8601 UTC format
207
+ activeUntil: string; // ISO 8601 UTC format
208
+ }
209
+ ```
210
+
211
+ **Example:**
212
+
213
+ ```javascript
214
+ promoTicker: [{
215
+ promoCode: 'SUMMER20',
216
+ text: ['20% Off Summer Sale', 'Free Shipping on $50+'],
217
+ separator: '•',
218
+ activeFrom: '2026-06-01T00:00:00Z',
219
+ activeUntil: '2026-08-31T23:59:59Z'
220
+ }]
221
+ ```
222
+
223
+ #### Proxy Configuration
224
+
225
+ ```typescript
226
+ interface IElementsProxyConfig {
227
+ baseUrl: string;
228
+ headers?: Record<string, string>;
229
+ }
230
+ ```
231
+
232
+ **Example:**
233
+
234
+ ```javascript
235
+ proxy: {
236
+ baseUrl: 'https://yoursite.com/api/elements-proxy',
237
+ headers: {
238
+ 'X-Custom-Header': 'value'
239
+ }
240
+ }
241
+ ```
242
+
243
+ See [Proxy Setup Guide](../integration/proxy-setup.md) for implementation.
244
+
245
+ #### GTM Configuration
246
+
247
+ ```typescript
248
+ interface IElementsGTMConfig {
249
+ gatewayUrl?: string;
250
+ }
251
+ ```
252
+
253
+ **Example:**
254
+
255
+ ```javascript
256
+ gtm: {
257
+ gatewayUrl: 'https://www.yoursite.com/metrics/'
258
+ }
259
+ ```
260
+
261
+ Set this when your site serves its own GTM container through Google tag gateway. See [Analytics → Google tag gateway](../reference/analytics.md#google-tag-gateway).
262
+
263
+ #### Checkout Configuration
264
+
265
+ ```typescript
266
+ interface ILiquidCommerceElementsCheckoutConfig {
267
+ pageUrl?: string; // Optional. URL pattern with {token} placeholder
268
+ }
269
+ ```
270
+
271
+ **Example:**
272
+
273
+ ```javascript
274
+ checkout: {
275
+ pageUrl: 'https://yoursite.com/checkout?lce_checkout={token}'
276
+ }
277
+ ```
278
+
279
+ #### Development Configuration
280
+
281
+ ```typescript
282
+ interface ILiquidCommerceElementsDevelopmentConfig {
283
+ customApiUrl?: string;
284
+ openShadowDom?: boolean;
285
+ mockMode?: boolean; // enable mock data responses (sends 'X-Liquid-Api-Mock-Mode' header)
286
+ }
287
+ ```
288
+
289
+ **Example:**
290
+
291
+ ```javascript
292
+ development: {
293
+ customApiUrl: 'http://localhost:3000/api',
294
+ openShadowDom: true // Use an OPEN (inspectable) Shadow DOM instead of the default closed mode; forced off in production
295
+ }
296
+ ```
297
+
298
+ ## Global Access
299
+
300
+ After initialization, each client is available globally under the `window.LiquidCommerce` namespace:
301
+
302
+ ```javascript
303
+ window.LiquidCommerce.elements // full client (from Elements())
304
+ window.LiquidCommerce.elementsBuilder // builder client (from ElementsBuilder())
305
+ window.LiquidCommerce.elementsCheckout // checkout-only client (from ElementsCheckout())
306
+ ```
307
+
308
+ This allows access from anywhere in your application:
309
+
310
+ ```javascript
311
+ // From any script
312
+ window.LiquidCommerce.elements.actions.cart.openCart();
313
+ ```
314
+
315
+ ## Client Ready Event
316
+
317
+ Listen for client initialization:
318
+
319
+ ```javascript
320
+ window.addEventListener('lce:actions.client_ready', ( event ) => {
321
+ const { isReady, version, timestamp } = event.detail.data;
322
+
323
+ console.log(`Elements SDK v${version} ready`);
324
+
325
+ // Safe to use client
326
+ window.LiquidCommerce.elements.injectProductElement([...]);
327
+ }, { once: true });
328
+ ```
329
+
330
+ ## Client Interface
331
+
332
+ ### ILiquidCommerceElementsClient
333
+
334
+ The main client interface:
335
+
336
+ ```typescript
337
+ interface ILiquidCommerceElementsClient {
338
+ // Injection methods
339
+ injectProductElement(params: IInjectProductElement[]): Promise<IInjectedComponent[]>;
340
+
341
+ injectAddressElement(containerId: string, options?: IAddressOptions): Promise<IInjectedComponent | null>;
342
+
343
+ injectCartElement(containerId: string): Promise<IInjectedComponent | null>;
344
+
345
+ injectCheckoutElement(params: IInjectCheckoutParams): Promise<IInjectedComponent | null>;
346
+
347
+ injectProductList(params: IInjectProductListParams): Promise<void>;
348
+
349
+ injectProductListSearch(params: IInjectProductListSearchParams): Promise<void>;
350
+
351
+ injectProductListFilters(params: IInjectProductListFiltersParams): Promise<void>;
352
+
353
+ // UI methods
354
+ ui: ILiquidCommerceElementsUIMethod;
355
+
356
+ // Actions
357
+ actions: ILiquidCommerceElementsActions;
358
+
359
+ // Component management
360
+ getInjectedComponents(): Map<string, IInjectedComponent>;
361
+
362
+ // Cleanup
363
+ destroy(): void;
364
+ }
365
+ ```
366
+
367
+ ### ILiquidCommerceElementsBuilderClient
368
+
369
+ The builder client (returned by `ElementsBuilder()`) exposes the same `inject*` methods plus a set of `update*Component` methods for applying theme/layout changes at runtime:
370
+
371
+ ```typescript
372
+ interface ILiquidCommerceElementsBuilderClient {
373
+ // Runtime theme/layout updates (builder-only)
374
+ updateComponentGlobalConfigs(configs: UpdateComponentGlobalConfigs): Promise<void>;
375
+ updateProductComponent(configs: UpdateProductComponent): Promise<void>;
376
+ updateAddressComponent(configs: UpdateAddressComponent): void;
377
+ updateCartComponent(configs: UpdateCartComponent): void;
378
+ updateCheckoutComponent(configs: UpdateCheckoutComponent): void;
379
+ updateProductListComponent(configs: UpdateProductListComponent): void;
380
+
381
+ // Injection methods
382
+ injectElement(params: IBuilderInjectElementParams): Promise<IInjectedComponent | null>;
383
+ injectProductElement(params: IInjectProductElement[]): Promise<IInjectedComponent[]>;
384
+ injectAddressElement(containerId: string, options?: IAddressOptions): Promise<IInjectedComponent | null>;
385
+ injectCartElement(containerId: string): Promise<IInjectedComponent | null>;
386
+ injectCheckoutElement(params: IInjectCheckoutBuilderParams): Promise<IInjectedComponent | null>;
387
+ injectProductList(params: IInjectProductListParams): Promise<void>;
388
+
389
+ // Actions
390
+ actions: ILiquidCommerceElementsActions;
391
+
392
+ // Cleanup
393
+ destroy(): void;
394
+ }
395
+ ```
396
+
397
+ #### Runtime theme updates (`update*Component`)
398
+
399
+ These methods are **builder-only** — they exist on the client returned by `ElementsBuilder()` and are **not** available on the full `Elements()` client. Each method applies theme changes to its scope and, when the passed `configs` include a non-empty `layout`, triggers targeted rerenders of only the components affected by those layout fields.
400
+
401
+ Return types are not uniform:
402
+
403
+ - `updateComponentGlobalConfigs()` and `updateProductComponent()` return `Promise<void>` (they may await product rerenders) — `await` them.
404
+ - `updateCartComponent()`, `updateCheckoutComponent()`, `updateAddressComponent()`, and `updateProductListComponent()` return `void` (synchronous).
405
+
406
+ ```javascript
407
+ const builder = await ElementsBuilder('YOUR_API_KEY', { env: 'production' });
408
+
409
+ // Asynchronous — await these
410
+ await builder.updateComponentGlobalConfigs({
411
+ theme: { primaryColor: '#0a7d33', buttonCornerRadius: '8px' },
412
+ layout: { allowPromoCodes: true }
413
+ });
414
+ await builder.updateProductComponent({
415
+ theme: { backgroundColor: '#ffffff' },
416
+ layout: { addToCartButtonText: 'Add to bag' }
417
+ });
418
+
419
+ // Synchronous — no await needed
420
+ builder.updateCartComponent({ layout: { drawerHeaderText: 'Your bag' } });
421
+ builder.updateCheckoutComponent({ layout: { placeOrderButtonText: 'Pay now' } });
422
+ ```
423
+
424
+ #### injectCheckoutElement (builder)
425
+
426
+ The builder's `injectCheckoutElement()` accepts `IInjectCheckoutBuilderParams`, which extends `IInjectCheckoutParams` with two **preview-only** fields:
427
+
428
+ ```typescript
429
+ interface IInjectCheckoutBuilderParams extends IInjectCheckoutParams {
430
+ simulatePresale?: boolean; // simulate a presale lock in builder mode
431
+ presaleExpiresInMinutes?: number; // minutes until the simulated lock expires (defaults to 15)
432
+ }
433
+ ```
434
+
435
+ `simulatePresale` and `presaleExpiresInMinutes` only take effect in the builder preview and have no counterpart on the full `Elements()` client's `injectCheckoutElement()`.
436
+
437
+ ```javascript
438
+ await builder.injectCheckoutElement({
439
+ containerId: 'checkout',
440
+ simulatePresale: true,
441
+ presaleExpiresInMinutes: 30
442
+ });
443
+ ```
444
+
445
+ ## Methods Overview
446
+
447
+ ### Injection Methods
448
+
449
+ - `injectProductElement()` - Inject product displays
450
+ - `injectAddressElement()` - Inject address input
451
+ - `injectCartElement()` - Inject cart (rarely needed)
452
+ - `injectCheckoutElement()` - Inject checkout
453
+ - `injectProductList()` - Inject product catalog
454
+ - `injectProductListSearch()` - Inject search box
455
+ - `injectProductListFilters()` - Inject filter panel
456
+
457
+ See [Injection Methods](./injection-methods.md) for details.
458
+
459
+ ### UI Methods
460
+
461
+ - `ui.cartButton()` - Add cart button
462
+ - `ui.floatingCartButton()` - Add floating cart button
463
+ - `ui.cartSubtotal()` - Display cart subtotal
464
+ - `ui.cartItemsCount()` - Display item count
465
+
466
+ See [UI Helpers](./ui-helpers.md) for details.
467
+
468
+ ### Actions
469
+
470
+ - `actions.product.*` - Product actions
471
+ - `actions.address.*` - Address actions
472
+ - `actions.cart.*` - Cart actions
473
+ - `actions.checkout.*` - Checkout actions
474
+
475
+ See [Actions](./actions/) for details.
476
+
477
+ ### Component Management
478
+
479
+ ```javascript
480
+ // Get all injected components
481
+ const components = client.getInjectedComponents();
482
+
483
+ // Get specific component
484
+ const productComponent = components.get('product-1');
485
+
486
+ // Component methods
487
+ productComponent.getType(); // 'product'
488
+ productComponent.getElement(); // <div id="product-1">...</div>
489
+ productComponent.rerender(); // Force rerender
490
+ productComponent.destroy(); // Remove from DOM and clean up
491
+ ```
492
+
493
+ ### destroy()
494
+
495
+ Remove the client and all injected components, cleaning up event listeners and internal state.
496
+
497
+ ```javascript
498
+ client.destroy();
499
+ ```
500
+
501
+ ## Error Handling
502
+
503
+ ### SDKError
504
+
505
+ All SDK errors use the custom `SDKError` class:
506
+
507
+ ```typescript
508
+ class SDKError extends Error {
509
+ constructor(message: string, reThrow?: boolean);
510
+
511
+ name: 'SDKError';
512
+ isSdk: boolean;
513
+ reThrow: boolean;
514
+ }
515
+ ```
516
+ ### Catching Errors
517
+
518
+ ```javascript
519
+ try {
520
+ await client.injectProductElement([
521
+ { containerId: 'product', identifier: 'invalid_id' }
522
+ ]);
523
+ } catch (error) {
524
+ if (error.name === 'SDKError') {
525
+ console.error('SDK Error:', error);
526
+ }
527
+ }
528
+ ```
529
+
530
+ ### Error Isolation
531
+
532
+ The SDK catches and contains its own errors:
533
+
534
+ ```javascript
535
+ // Even if SDK throws, your app continues
536
+ window.LiquidCommerce.elements.actions.cart.addProduct([/* invalid */]);
537
+
538
+ // Your code still runs
539
+ console.log('App still working');
540
+ ```
541
+
542
+ ## TypeScript Support
543
+
544
+ ### Importing Types
545
+
546
+ ```typescript
547
+ import { Elements } from '@liquidcommerce/elements-sdk';
548
+ import type {
549
+ ILiquidCommerceElementsClient,
550
+ ILiquidCommerceElementsConfig,
551
+ IInjectProductElement,
552
+ IInjectedComponent
553
+ } from '@liquidcommerce/elements-sdk';
554
+
555
+ const config: ILiquidCommerceElementsConfig = {
556
+ env: 'production'
557
+ };
558
+
559
+ // Elements() resolves to `null` on failure, so the type is nullable.
560
+ const client: ILiquidCommerceElementsClient | null = await Elements('KEY', config);
561
+ ```
562
+
563
+ ### Type Exports
564
+
565
+ All public interfaces are exported from the main package:
566
+
567
+ ```typescript
568
+ import type {
569
+ // Client types
570
+ ILiquidCommerceElementsClient,
571
+ ILiquidCommerceElementsConfig,
572
+
573
+ // Injection types
574
+ IInjectProductElement,
575
+ IInjectCheckoutParams,
576
+ IInjectedComponent,
577
+
578
+ // Configuration types
579
+ IClientCustomThemeConfig,
580
+ IComponentGlobalConfigs,
581
+ IProductComponent,
582
+ ICartComponent,
583
+ ICheckoutComponent,
584
+ IAddressComponent,
585
+
586
+ // Enum types
587
+ ElementsEnv,
588
+ DebugMode,
589
+ FulfillmentType,
590
+ ComponentType
591
+ } from '@liquidcommerce/elements-sdk';
592
+ ```
593
+
594
+ See [TypeScript Types](./typescript-types.md) for complete type reference.
595
+
596
+ ## Best Practices
597
+
598
+ ### Single Client Instance
599
+
600
+ Create one client instance and reuse it:
601
+
602
+ ```javascript
603
+ // Good
604
+ const client = await Elements('KEY', { env: 'production' });
605
+ await client.injectProductElement([...]);
606
+ await client.injectCartElement('cart');
607
+
608
+ // Bad - creates multiple instances
609
+ await Elements('KEY', { env: 'production' });
610
+ await Elements('KEY', { env: 'production' });
611
+ ```
612
+
613
+ ### Use Global Access
614
+
615
+ After initialization, use `window.LiquidCommerce.elements`:
616
+
617
+ ```javascript
618
+ // Initialize once
619
+ await Elements('KEY', { env: 'production' });
620
+
621
+ // Use globally
622
+ window.LiquidCommerce.elements.actions.cart.openCart();
623
+ window.LiquidCommerce.elements.ui.cartButton('cart-btn');
624
+ ```
625
+
626
+ ### Check Client Ready
627
+
628
+ Wait for client ready before using:
629
+
630
+ ```javascript
631
+ if (window.LiquidCommerce?.elements) {
632
+ // Client is ready
633
+ window.LiquidCommerce.elements.actions.cart.openCart();
634
+ } else {
635
+ // Wait for client ready
636
+ window.addEventListener('lce:actions.client_ready', () => {
637
+ window.LiquidCommerce.elements.actions.cart.openCart();
638
+ }, { once: true });
639
+ }
640
+ ```
641
+
642
+ ### Handle Initialization Failures
643
+
644
+ ```javascript
645
+ const client = await Elements('KEY', { env: 'production' });
646
+
647
+ if (!client) {
648
+ console.error('Failed to initialize Elements SDK');
649
+ // Show fallback UI or error message
650
+ showErrorPage();
651
+ return;
652
+ }
653
+
654
+ // Client initialized successfully
655
+ await client.injectProductElement([...]);
656
+ ```
657
+
658
+ ## See Also
659
+
660
+ - [Injection Methods](./injection-methods.md) - Component injection API
661
+ - [UI Helpers](./ui-helpers.md) - UI helper methods
662
+ - [Actions](./actions/) - Action APIs
663
+ - [Configuration](./configuration.md) - Configuration options
664
+ - [TypeScript Types](./typescript-types.md) - Type definitions