@liquidcommerce/elements-sdk 2.2.0-beta.4 → 2.2.0-beta.40

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 (79) hide show
  1. package/README.md +1715 -569
  2. package/dist/index.esm.js +11813 -9048
  3. package/dist/types/core/auth.service.d.ts +10 -4
  4. package/dist/types/core/base-component.service.d.ts +3 -0
  5. package/dist/types/core/circuit-breaker.service.d.ts +54 -0
  6. package/dist/types/core/client/client-action.service.d.ts +16 -13
  7. package/dist/types/core/client/client-config.service.d.ts +5 -3
  8. package/dist/types/core/command/common-command.service.d.ts +2 -1
  9. package/dist/types/core/debug-panel/debug-panel.service.d.ts +43 -0
  10. package/dist/types/core/debug-panel/debug-panel.styles.d.ts +1 -0
  11. package/dist/types/core/fingerprint.service.d.ts +4 -9
  12. package/dist/types/core/google-tag-manager.service.d.ts +127 -2
  13. package/dist/types/core/logger/logger-factory.d.ts +3 -0
  14. package/dist/types/core/logger/logger.service.d.ts +8 -5
  15. package/dist/types/core/pubsub/interfaces/cart.interface.d.ts +1 -0
  16. package/dist/types/core/pubsub/interfaces/checkout.interface.d.ts +46 -6
  17. package/dist/types/core/pubsub/interfaces/core.interface.d.ts +2 -3
  18. package/dist/types/core/pubsub/interfaces/product.interface.d.ts +43 -6
  19. package/dist/types/core/pubsub/pubsub.service.d.ts +2 -1
  20. package/dist/types/core/singleton-manager.service.d.ts +3 -3
  21. package/dist/types/core/store/interfaces/cart.interface.d.ts +1 -1
  22. package/dist/types/core/store/interfaces/checkout.interface.d.ts +0 -1
  23. package/dist/types/core/store/interfaces/core.interface.d.ts +2 -2
  24. package/dist/types/core/store/interfaces/product.interface.d.ts +18 -7
  25. package/dist/types/core/store/store.service.d.ts +2 -1
  26. package/dist/types/core/telemetry/telemetry.interface.d.ts +80 -0
  27. package/dist/types/core/telemetry/telemetry.service.d.ts +27 -0
  28. package/dist/types/elements-base-client.d.ts +49 -0
  29. package/dist/types/elements-builder-client.d.ts +2 -0
  30. package/dist/types/elements-client-helper.d.ts +3 -0
  31. package/dist/types/enums/core.enum.d.ts +0 -1
  32. package/dist/types/enums/debug.enum.d.ts +6 -0
  33. package/dist/types/enums/index.d.ts +1 -0
  34. package/dist/types/index.d.ts +1 -0
  35. package/dist/types/index.umd.d.ts +2 -2
  36. package/dist/types/interfaces/cloud/product.interface.d.ts +2 -0
  37. package/dist/types/interfaces/configs/checkout.interface.d.ts +1 -1
  38. package/dist/types/interfaces/configs/product.interface.d.ts +2 -0
  39. package/dist/types/interfaces/core.interface.d.ts +34 -19
  40. package/dist/types/modules/address/address.command.d.ts +1 -3
  41. package/dist/types/modules/api-client/api-client.service.d.ts +1 -0
  42. package/dist/types/modules/cart/cart.commands.d.ts +1 -1
  43. package/dist/types/modules/cart/cart.component.d.ts +1 -2
  44. package/dist/types/modules/cart/components/cart-footer.component.d.ts +1 -0
  45. package/dist/types/modules/cart/components/cart-item.component.d.ts +2 -6
  46. package/dist/types/modules/cart/components/index.d.ts +2 -0
  47. package/dist/types/modules/checkout/checkout.commands.d.ts +3 -2
  48. package/dist/types/modules/checkout/checkout.component.d.ts +1 -2
  49. package/dist/types/modules/checkout/components/checkout-summary-section.component.d.ts +2 -0
  50. package/dist/types/modules/checkout/components/information/checkout-delivery-information-form.component.d.ts +1 -1
  51. package/dist/types/modules/checkout/components/summary/checkout-item-quantity.component.d.ts +0 -2
  52. package/dist/types/modules/checkout/components/summary/checkout-item.component.d.ts +2 -1
  53. package/dist/types/modules/checkout/components/summary/checkout-items.component.d.ts +1 -0
  54. package/dist/types/modules/checkout/components/summary/checkout-place-order-button.component.d.ts +0 -1
  55. package/dist/types/modules/checkout/constant.d.ts +0 -1
  56. package/dist/types/modules/product/components/index.d.ts +1 -0
  57. package/dist/types/modules/product/components/product-add-to-cart-section.component.d.ts +1 -0
  58. package/dist/types/modules/product/components/product-interactions.component.d.ts +4 -1
  59. package/dist/types/modules/product/components/product-price.component.d.ts +1 -0
  60. package/dist/types/modules/product/components/product-retailers.component.d.ts +1 -0
  61. package/dist/types/modules/product/product.commands.d.ts +1 -1
  62. package/dist/types/modules/theme-provider/services/font-manager.service.d.ts +1 -0
  63. package/dist/types/modules/ui-components/engraving/engraving-form.component.d.ts +13 -11
  64. package/dist/types/modules/ui-components/engraving/engraving-view.component.d.ts +4 -9
  65. package/dist/types/modules/ui-components/lce-element/lce-element.component.d.ts +2 -0
  66. package/dist/types/static/icon/index.d.ts +0 -1
  67. package/dist/types/utils/format.d.ts +2 -1
  68. package/docs/ACTIONS.md +1300 -0
  69. package/docs/BROWSER_SUPPORT.md +279 -0
  70. package/docs/CONFIGURATION.md +740 -0
  71. package/docs/DOCUMENTATION_INDEX.md +311 -0
  72. package/docs/EVENTS.md +765 -0
  73. package/docs/PROXY.md +228 -0
  74. package/docs/THEMING.md +592 -0
  75. package/docs/TROUBLESHOOTING.md +793 -0
  76. package/package.json +18 -18
  77. package/umd/elements.js +1 -1
  78. package/dist/types/modules/product/constant.d.ts +0 -2
  79. package/dist/types/static/icon/completed.icon.d.ts +0 -2
@@ -0,0 +1,740 @@
1
+ # Configuration Reference
2
+
3
+ Complete reference for all LiquidCommerce Elements SDK configuration options.
4
+
5
+ ## Basic Configuration
6
+
7
+ ```javascript
8
+ const client = await Elements('YOUR_API_KEY', {
9
+ env: 'production',
10
+ debugMode: 'none',
11
+ isBuilder: false,
12
+ customTheme: {},
13
+ proxy: {},
14
+ promoTicker: []
15
+ });
16
+ ```
17
+
18
+ ## Configuration Options
19
+
20
+ ### `env` (required)
21
+
22
+ **Type:** `'local' | 'development' | 'staging' | 'production'`
23
+ **Default:** `'production'`
24
+
25
+ Specifies the API environment to use.
26
+
27
+ ```javascript
28
+ env: 'production' // Live environment
29
+ env: 'staging' // Pre-production testing
30
+ env: 'development' // Development with extra logging
31
+ env: 'local' // Local development
32
+ ```
33
+
34
+ **Environment URLs:**
35
+ - `production`: `https://elements.liquidcommerce.us`
36
+ - `staging`: `https://staging-elements.liquidcommerce.us`
37
+ - `development`: `https://dev-elements.liquidcommerce.us`
38
+ - `local`: `http://localhost:3000`
39
+
40
+ ### `debugMode`
41
+
42
+ **Type:** `'none' | 'console' | 'panel'`
43
+ **Default:** `'none'`
44
+
45
+ Controls logging and debugging output.
46
+
47
+ ```javascript
48
+ debugMode: 'none' // No logging (production)
49
+ debugMode: 'console' // Console logs only
50
+ debugMode: 'panel' // Visual debug panel + console
51
+ ```
52
+
53
+ **Debug panel features:**
54
+ - Real-time event stream
55
+ - API call inspector
56
+ - State viewer
57
+ - Performance metrics
58
+
59
+ **Note:** Automatically disabled in production environment regardless of setting.
60
+
61
+ ### `isBuilder`
62
+
63
+ **Type:** `boolean`
64
+ **Default:** `false`
65
+
66
+ Enables builder mode for theme development and testing.
67
+
68
+ ```javascript
69
+ isBuilder: true // Enables builder.* methods
70
+ ```
71
+
72
+ **Builder mode provides:**
73
+ - `client.builder.updateComponentGlobalConfigs()`
74
+ - `client.builder.updateProductComponent()`
75
+ - `client.builder.updateCartComponent()`
76
+ - `client.builder.updateCheckoutComponent()`
77
+ - `client.builder.updateAddressComponent()`
78
+
79
+ **Use case:** Theme customization and testing.
80
+
81
+ ### `customTheme`
82
+
83
+ **Type:** `object`
84
+ **Default:** `{}`
85
+
86
+ Custom theme configuration. See [`THEMING.md`](./THEMING.md) for complete reference.
87
+
88
+ ```javascript
89
+ customTheme: {
90
+ global: {
91
+ colors: {
92
+ primary: '#007bff',
93
+ secondary: '#6c757d'
94
+ },
95
+ typography: {
96
+ fontFamily: 'Inter, sans-serif',
97
+ fontSize: '16px'
98
+ },
99
+ layout: {
100
+ enablePersonalization: true,
101
+ personalizationText: 'Personalize your product',
102
+ personalizationCardStyle: 'outlined',
103
+ allowPromoCodes: true,
104
+ inputFieldStyle: 'outlined',
105
+ poweredByMode: 'light' // Can be customized
106
+ // Note: showPoweredBy cannot be customized (controlled by LiquidCommerce)
107
+ }
108
+ },
109
+ product: { /* product theme */ },
110
+ cart: { /* cart theme */ },
111
+ checkout: { /* checkout theme */ },
112
+ address: { /* address theme */ }
113
+ }
114
+ ```
115
+
116
+ **Key Theme Categories:**
117
+
118
+ - **`global`**: Affects all components (colors, fonts, personalization settings)
119
+ - **`product`**: Product display customization
120
+ - **`cart`**: Cart drawer and item display
121
+ - **`checkout`**: Checkout flow and completion screen
122
+ - **`address`**: Address input and selection
123
+
124
+ **Personalization (Engraving) Settings:**
125
+
126
+ The personalization feature is configured in `global.layout`:
127
+
128
+ ```javascript
129
+ customTheme: {
130
+ global: {
131
+ layout: {
132
+ enablePersonalization: true, // Enable/disable engraving globally
133
+ personalizationText: 'Make it yours', // Button text for adding personalization
134
+ personalizationCardStyle: 'outlined' // Style: 'outlined' | 'filled'
135
+ }
136
+ }
137
+ }
138
+ ```
139
+
140
+ - **`enablePersonalization`**: Master switch for engraving feature
141
+ - **`personalizationText`**: Call-to-action text on product pages
142
+ - **`personalizationCardStyle`**: Visual style in cart/checkout ('outlined' or 'filled')
143
+ - **`poweredByMode`**: Visual mode for "Powered by" branding ('light' or 'dark')
144
+
145
+ **Protected Setting:**
146
+ ⚠️ **`showPoweredBy`** is a read-only setting controlled by LiquidCommerce. This paid feature cannot be customized through the `customTheme` configuration and is managed via your LiquidCommerce dashboard. However, you can customize `poweredByMode` to match your site's theme.
147
+
148
+ ### `proxy`
149
+
150
+ **Type:** `object`
151
+ **Default:** `null`
152
+
153
+ Proxy configuration for routing API requests through your server.
154
+
155
+ ```javascript
156
+ proxy: {
157
+ baseUrl: 'https://yourdomain.com/api/liquidcommerce',
158
+ headers: {
159
+ 'X-Custom-Header': 'value'
160
+ }
161
+ }
162
+ ```
163
+
164
+ **Properties:**
165
+
166
+ #### `proxy.baseUrl`
167
+
168
+ **Type:** `string` (required)
169
+
170
+ Base URL for your proxy endpoint.
171
+
172
+ ```javascript
173
+ baseUrl: 'https://yourdomain.com/api/liquidcommerce'
174
+ ```
175
+
176
+ The SDK automatically appends API paths: `/api/products`, `/api/cart`, etc.
177
+
178
+ #### `proxy.headers`
179
+
180
+ **Type:** `object` (optional)
181
+
182
+ Custom headers to include in proxied requests.
183
+
184
+ ```javascript
185
+ headers: {
186
+ 'X-Custom-Auth': 'your-token',
187
+ 'X-Request-Id': 'unique-id'
188
+ }
189
+ ```
190
+
191
+ See [`PROXY.md`](./PROXY.md) for implementation guide.
192
+
193
+ ### `promoTicker`
194
+
195
+ **Type:** `array`
196
+ **Default:** `[]`
197
+
198
+ Promotional ticker configuration for rotating messages.
199
+
200
+ ```javascript
201
+ promoTicker: [
202
+ {
203
+ promoCode: 'FREESHIP',
204
+ text: ['Free Shipping Today!', 'Use code FREESHIP'],
205
+ separator: '•',
206
+ activeFrom: '2025-01-01T00:00:00Z',
207
+ activeUntil: '2025-12-31T23:59:59Z'
208
+ }
209
+ ]
210
+ ```
211
+
212
+ **Properties:**
213
+
214
+ #### `promoCode` (required)
215
+
216
+ **Type:** `string`
217
+
218
+ The promo code to apply when clicked.
219
+
220
+ #### `text` (required)
221
+
222
+ **Type:** `string[]`
223
+
224
+ Array of messages to rotate through.
225
+
226
+ ```javascript
227
+ text: ['Message 1', 'Message 2', 'Message 3']
228
+ ```
229
+
230
+ #### `separator` (optional)
231
+
232
+ **Type:** `string`
233
+ **Default:** `'•'`
234
+
235
+ Separator between rotating messages.
236
+
237
+ ```javascript
238
+ separator: '•' // Bullet
239
+ separator: '|' // Pipe
240
+ separator: '→' // Arrow
241
+ ```
242
+
243
+ #### `activeFrom` (optional)
244
+
245
+ **Type:** `string` (ISO 8601)
246
+
247
+ Start date/time for the promotion.
248
+
249
+ ```javascript
250
+ activeFrom: '2025-01-01T00:00:00Z'
251
+ ```
252
+
253
+ #### `activeUntil` (optional)
254
+
255
+ **Type:** `string` (ISO 8601)
256
+
257
+ End date/time for the promotion.
258
+
259
+ ```javascript
260
+ activeUntil: '2025-12-31T23:59:59Z'
261
+ ```
262
+
263
+ **Note:** Only active promotions are displayed.
264
+
265
+ ## Auto-Initialization Configuration
266
+
267
+ When using auto-initialization, configure via `data-` attributes on the script tag.
268
+
269
+ ### Required Attributes
270
+
271
+ ```html
272
+ <script
273
+ data-liquid-commerce-elements
274
+ data-token="YOUR_API_KEY"
275
+ src="https://assets-elements.liquidcommerce.us/all/elements.js"
276
+ ></script>
277
+ ```
278
+
279
+ #### `data-liquid-commerce-elements`
280
+
281
+ **Type:** flag (no value)
282
+
283
+ Enables auto-initialization.
284
+
285
+ #### `data-token`
286
+
287
+ **Type:** `string` (required)
288
+
289
+ Your LiquidCommerce API key.
290
+
291
+ ### Optional Attributes
292
+
293
+ #### `data-env`
294
+
295
+ **Type:** `'production' | 'staging' | 'development' | 'local'`
296
+ **Default:** `'production'`
297
+
298
+ ```html
299
+ data-env="production"
300
+ ```
301
+
302
+ #### `data-debug-mode`
303
+
304
+ **Type:** `'console' | 'panel'`
305
+ **Default:** Not set
306
+
307
+ ```html
308
+ data-debug-mode="console"
309
+ ```
310
+
311
+ #### `data-cart-button`
312
+
313
+ **Type:** `string`
314
+
315
+ Container ID, CSS selector, or position-prefixed selector for simple cart button (no badge).
316
+
317
+ ```html
318
+ <!-- Simple ID (with or without # prefix) -->
319
+ data-cart-button="header-cart" <!-- Works with or without # -->
320
+ data-cart-button="#header-cart" <!-- Also works with # prefix -->
321
+
322
+ <!-- CSS Selector (from browser inspect tool) -->
323
+ data-cart-button=".header .nav-links"
324
+ data-cart-button="#main-navigation"
325
+
326
+ <!-- Position-prefixed selectors -->
327
+ data-cart-button="above:.header .logo" <!-- Place above the target -->
328
+ data-cart-button="below:#main-navigation" <!-- Place below the target -->
329
+ data-cart-button="below:main-navigation" <!-- Also works without # prefix -->
330
+ data-cart-button="replace:.old-cart" <!-- Replace the target -->
331
+ data-cart-button="inside:.header .nav" <!-- Place inside the target (default) -->
332
+ ```
333
+
334
+ #### `data-cart-badge-button`
335
+
336
+ **Type:** `string`
337
+
338
+ Container ID, CSS selector, or position-prefixed selector for cart button with item count badge.
339
+
340
+ ```html
341
+ <!-- Simple ID (with or without # prefix) -->
342
+ data-cart-badge-button="header-cart" <!-- Works with or without # -->
343
+ data-cart-badge-button="#header-cart" <!-- Also works with # prefix -->
344
+
345
+ <!-- CSS Selector (from browser inspect tool) -->
346
+ data-cart-badge-button=".header .nav-links"
347
+ data-cart-badge-button="#main-navigation"
348
+
349
+ <!-- Position-prefixed selectors -->
350
+ data-cart-badge-button="above:.header .logo" <!-- Place above the target -->
351
+ data-cart-badge-button="below:#main-navigation" <!-- Place below the target -->
352
+ data-cart-badge-button="replace:.old-cart" <!-- Replace the target -->
353
+ data-cart-badge-button="inside:.header .nav" <!-- Place inside the target (default) -->
354
+ ```
355
+
356
+ **Position Prefixes:**
357
+ - `above:` - Place above the target element
358
+ - `below:` - Place below the target element
359
+ - `replace:` - Replace the target element
360
+ - `inside:` - Place inside the target element (default)
361
+
362
+ #### `data-cart-button-hidden`
363
+
364
+ **Type:** flag (no value)
365
+
366
+ Hide cart button completely.
367
+
368
+ ```html
369
+ data-cart-button-hidden
370
+ ```
371
+
372
+ ### Cart Button Examples
373
+
374
+ **Simple cart button (no badge):**
375
+ ```html
376
+ <script
377
+ data-liquid-commerce-elements
378
+ data-token="your-api-key"
379
+ data-cart-button="header-cart"
380
+ src="elements.js">
381
+ </script>
382
+ ```
383
+
384
+ **Cart button with item count badge:**
385
+ ```html
386
+ <script
387
+ data-liquid-commerce-elements
388
+ data-token="your-api-key"
389
+ data-cart-badge-button="header-cart"
390
+ src="elements.js">
391
+ </script>
392
+ ```
393
+
394
+ **Using position-prefixed selectors:**
395
+ ```html
396
+ <!-- Place inside the target element (default) -->
397
+ <script
398
+ data-liquid-commerce-elements
399
+ data-token="your-api-key"
400
+ data-cart-badge-button="inside:.header .nav-links"
401
+ src="elements.js">
402
+ </script>
403
+
404
+ <!-- Place above the target element -->
405
+ <script
406
+ data-liquid-commerce-elements
407
+ data-token="your-api-key"
408
+ data-cart-button="above:.header .logo"
409
+ src="elements.js">
410
+ </script>
411
+
412
+ <!-- Place below the target element -->
413
+ <script
414
+ data-liquid-commerce-elements
415
+ data-token="your-api-key"
416
+ data-cart-badge-button="below:#main-navigation"
417
+ src="elements.js">
418
+ </script>
419
+
420
+ <!-- Replace the target element -->
421
+ <script
422
+ data-liquid-commerce-elements
423
+ data-token="your-api-key"
424
+ data-cart-button="replace:.old-cart-button"
425
+ src="elements.js">
426
+ </script>
427
+ ```
428
+
429
+ **No cart button:**
430
+ ```html
431
+ <script
432
+ data-liquid-commerce-elements
433
+ data-token="your-api-key"
434
+ data-cart-button-hidden
435
+ src="elements.js">
436
+ </script>
437
+ ```
438
+
439
+ **Default behavior (floating cart button with badge):**
440
+ ```html
441
+ <script
442
+ data-liquid-commerce-elements
443
+ data-token="your-api-key"
444
+ src="elements.js">
445
+ </script>
446
+ ```
447
+
448
+ ### Getting CSS Selectors from Browser
449
+
450
+ **Super Easy Method:**
451
+ 1. **Right-click** on any element where you want the cart button
452
+ 2. Select **"Inspect"** or **"Inspect Element"**
453
+ 3. In developer tools, **right-click** on the highlighted element
454
+ 4. Select **"Copy" → "Copy selector"**
455
+ 5. Paste the selector into your `data-cart-button` or `data-cart-badge-button` attribute
456
+
457
+ **Example:**
458
+ ```html
459
+ <!-- After copying selector from browser inspect tool -->
460
+ <script
461
+ data-liquid-commerce-elements
462
+ data-token="your-api-key"
463
+ data-cart-badge-button="body > div.container > header > nav > div.nav-links"
464
+ src="elements.js">
465
+ </script>
466
+ ```
467
+
468
+ ### Product Configuration
469
+
470
+ #### Method 1: Direct Attributes
471
+
472
+ ```html
473
+ data-container-1="product-1"
474
+ data-product-1="00619947000020"
475
+ data-container-2="product-2"
476
+ data-product-2="00832889005513"
477
+ ```
478
+
479
+ #### Method 2: JSON Configuration
480
+
481
+ ```html
482
+ <script data-liquid-commerce-elements-products type="application/json">
483
+ [
484
+ { "containerId": "product-1", "identifier": "00619947000020" },
485
+ { "containerId": "product-2", "identifier": "00832889005513" }
486
+ ]
487
+ </script>
488
+ ```
489
+
490
+ #### Method 3: Annotated Elements
491
+
492
+ ```html
493
+ <div data-lce-product="00619947000020"></div>
494
+ <div data-lce-product="00832889005513"></div>
495
+ ```
496
+
497
+ ### URL Parameter Configuration
498
+
499
+ #### `data-product-param`
500
+
501
+ **Type:** `string`
502
+
503
+ URL parameter name for auto-adding products to cart.
504
+
505
+ ```html
506
+ data-product-param="lce_product"
507
+ ```
508
+
509
+ **Usage:** `?lce_product=00619947000020&lce_fulfillment=shipping`
510
+
511
+ #### `data-product-fulfillment-type-param`
512
+
513
+ **Type:** `string`
514
+
515
+ URL parameter name for fulfillment type.
516
+
517
+ ```html
518
+ data-product-fulfillment-type-param="lce_fulfillment"
519
+ ```
520
+
521
+ **Values:** `shipping` or `onDemand`
522
+
523
+ #### `data-promo-code-param`
524
+
525
+ **Type:** `string`
526
+
527
+ URL parameter name for auto-applying promo codes.
528
+
529
+ ```html
530
+ data-promo-code-param="lce_promo"
531
+ ```
532
+
533
+ **Usage:** `?lce_promo=SUMMER20`
534
+
535
+ ### Promo Ticker Configuration
536
+
537
+ #### `data-promo-code`
538
+
539
+ **Type:** `string`
540
+
541
+ Promo code to apply.
542
+
543
+ ```html
544
+ data-promo-code="FREESHIP"
545
+ ```
546
+
547
+ #### `data-promo-text`
548
+
549
+ **Type:** `string` (pipe-separated)
550
+
551
+ Messages to display.
552
+
553
+ ```html
554
+ data-promo-text="Free Shipping Today!|Use code FREESHIP"
555
+ ```
556
+
557
+ #### `data-promo-separator`
558
+
559
+ **Type:** `string`
560
+ **Default:** `'•'`
561
+
562
+ ```html
563
+ data-promo-separator="•"
564
+ ```
565
+
566
+ #### `data-promo-active-from`
567
+
568
+ **Type:** `string` (ISO 8601)
569
+
570
+ ```html
571
+ data-promo-active-from="2025-01-01T00:00:00Z"
572
+ ```
573
+
574
+ #### `data-promo-active-until`
575
+
576
+ **Type:** `string` (ISO 8601)
577
+
578
+ ```html
579
+ data-promo-active-until="2025-12-31T23:59:59Z"
580
+ ```
581
+
582
+ ## TypeScript Types
583
+
584
+ ### `ILiquidCommerceElementsConfig`
585
+
586
+ ```typescript
587
+ interface ILiquidCommerceElementsConfig {
588
+ env?: 'local' | 'development' | 'staging' | 'production';
589
+ debugMode?: 'none' | 'console' | 'panel';
590
+ isBuilder?: boolean;
591
+ customTheme?: IClientCustomThemeConfig;
592
+ proxy?: IElementsProxyConfig;
593
+ promoTicker?: IPromoTicker[];
594
+ }
595
+ ```
596
+
597
+ ### `IElementsProxyConfig`
598
+
599
+ ```typescript
600
+ interface IElementsProxyConfig {
601
+ baseUrl: string;
602
+ headers?: Record<string, string>;
603
+ }
604
+ ```
605
+
606
+ ### `IPromoTicker`
607
+
608
+ ```typescript
609
+ interface IPromoTicker {
610
+ promoCode: string;
611
+ text: string[];
612
+ separator: string;
613
+ activeFrom: string; // ISO 8601 UTC format
614
+ activeUntil: string; // ISO 8601 UTC format
615
+ }
616
+ ```
617
+
618
+ ## Configuration Examples
619
+
620
+ ### Production Setup
621
+
622
+ ```javascript
623
+ const client = await Elements('YOUR_PRODUCTION_API_KEY', {
624
+ env: 'production',
625
+ debugMode: 'none',
626
+ proxy: {
627
+ baseUrl: 'https://yourdomain.com/api/liquidcommerce'
628
+ },
629
+ customTheme: {
630
+ global: {
631
+ colors: {
632
+ primary: '#007bff'
633
+ }
634
+ }
635
+ }
636
+ });
637
+ ```
638
+
639
+ ### Development Setup
640
+
641
+ ```javascript
642
+ const client = await Elements('YOUR_DEV_API_KEY', {
643
+ env: 'development',
644
+ debugMode: 'panel',
645
+ isBuilder: true,
646
+ customTheme: {
647
+ global: {
648
+ colors: {
649
+ primary: '#ff6b6b'
650
+ }
651
+ }
652
+ }
653
+ });
654
+ ```
655
+
656
+ ### With Promo Ticker
657
+
658
+ ```javascript
659
+ const client = await Elements('YOUR_API_KEY', {
660
+ env: 'production',
661
+ promoTicker: [
662
+ {
663
+ promoCode: 'SUMMER20',
664
+ text: ['20% Off Summer Sale!', 'Use code SUMMER20'],
665
+ separator: '•',
666
+ activeFrom: '2025-06-01T00:00:00Z',
667
+ activeUntil: '2025-08-31T23:59:59Z'
668
+ }
669
+ ]
670
+ });
671
+ ```
672
+
673
+ ## Configuration Validation
674
+
675
+ The SDK validates configuration on initialization:
676
+
677
+ ```javascript
678
+ try {
679
+ const client = await Elements('YOUR_API_KEY', {
680
+ env: 'invalid' // ❌ Will throw error
681
+ });
682
+ } catch (error) {
683
+ console.error('Invalid configuration:', error);
684
+ }
685
+ ```
686
+
687
+ **Common validation errors:**
688
+ - Invalid environment value
689
+ - Missing API key
690
+ - Invalid proxy baseUrl
691
+ - Malformed promo ticker dates
692
+
693
+ ## Environment Variables
694
+
695
+ For framework integrations, use environment variables:
696
+
697
+ ### React / Next.js
698
+
699
+ ```javascript
700
+ const client = await Elements(process.env.REACT_APP_LCE_API_KEY, {
701
+ env: process.env.REACT_APP_LCE_ENV || 'production'
702
+ });
703
+ ```
704
+
705
+ ### Vue
706
+
707
+ ```javascript
708
+ const client = await Elements(process.env.VUE_APP_LCE_API_KEY, {
709
+ env: process.env.VUE_APP_LCE_ENV || 'production'
710
+ });
711
+ ```
712
+
713
+ ### Node.js / Server-Side
714
+
715
+ ```javascript
716
+ const client = await Elements(process.env.LCE_API_KEY, {
717
+ env: process.env.NODE_ENV === 'production' ? 'production' : 'development'
718
+ });
719
+ ```
720
+
721
+ ## Configuration Best Practices
722
+
723
+ 1. **Use environment variables** for API keys (never hardcode)
724
+ 2. **Enable debug mode only in development** (security risk in production)
725
+ 3. **Pin to specific version** in production for stability
726
+ 4. **Configure proxy** if targeting ad blocker-heavy audiences
727
+ 5. **Use minimal theme overrides** for optimal performance
728
+ 6. **Set GTM container ID** for analytics tracking
729
+ 7. **Test configuration** in staging before production
730
+ 8. **Validate promo dates** to avoid expired promotions
731
+ 9. **Use builder mode** only in development (performance overhead)
732
+ 10. **Monitor proxy** health if using custom proxy
733
+
734
+ ## Related Documentation
735
+
736
+ - [Theming Guide](./THEMING.md) - Complete theme configuration reference
737
+ - [Proxy Setup](./PROXY.md) - Proxy implementation guide
738
+ - [Actions Reference](./ACTIONS.md) - Programmatic control API
739
+ - [Events Reference](./EVENTS.md) - Event system and tracking
740
+