@liquidcommerce/elements-sdk 2.6.0-beta.102 → 2.6.0-beta.103
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.checkout.esm.js +7482 -7484
- package/dist/index.esm.js +12249 -12251
- package/dist/ssr-stub.checkout.esm.js +0 -1
- package/dist/ssr-stub.esm.js +0 -1
- package/dist/types/constants/core.constant.d.ts +0 -1
- package/dist/types/enums/core.enum.d.ts +0 -1
- package/docs/v1/api/client.md +2 -2
- package/docs/v1/api/configuration.md +2 -2
- package/docs/v1/api/typescript-types.md +1 -1
- package/docs/v1/getting-started/concepts.md +4 -4
- package/docs/v1/getting-started/installation.md +3 -3
- package/docs/v1/guides/best-practices.md +4 -4
- package/docs/v1/reference/analytics.md +1 -2
- package/docs/v1/reference/telemetry.md +1 -1
- package/package.json +1 -1
package/dist/ssr-stub.esm.js
CHANGED
package/docs/v1/api/client.md
CHANGED
|
@@ -103,7 +103,7 @@ Complete configuration interface for the full SDK.
|
|
|
103
103
|
```typescript
|
|
104
104
|
interface ILiquidCommerceElementsConfig {
|
|
105
105
|
// Optional
|
|
106
|
-
env?: ElementsEnv; // defaults to 'production' ('
|
|
106
|
+
env?: ElementsEnv; // defaults to 'production' ('staging' | 'production')
|
|
107
107
|
debugMode?: DebugMode; // 'none' | 'console' | 'panel'
|
|
108
108
|
customTheme?: IClientCustomThemeConfig;
|
|
109
109
|
promoTicker?: IPromoTicker[];
|
|
@@ -116,7 +116,7 @@ interface ILiquidCommerceElementsConfig {
|
|
|
116
116
|
#### Environment
|
|
117
117
|
|
|
118
118
|
```typescript
|
|
119
|
-
type ElementsEnv = '
|
|
119
|
+
type ElementsEnv = 'staging' | 'production';
|
|
120
120
|
```
|
|
121
121
|
|
|
122
122
|
Determines which API environment to use.
|
|
@@ -22,7 +22,7 @@ interface ILiquidCommerceElementsConfig {
|
|
|
22
22
|
|
|
23
23
|
| Property | Type | Required | Description |
|
|
24
24
|
|----------|------|----------|-------------|
|
|
25
|
-
| `env` | `'
|
|
25
|
+
| `env` | `'staging' \| 'production'` | No | API environment |
|
|
26
26
|
| `promoTicker` | `IPromoTicker[]` | No | Promotional ticker configurations |
|
|
27
27
|
| `customTheme` | `IClientCustomThemeConfig` | No | Theme overrides for all components |
|
|
28
28
|
| `debugMode` | `'none' \| 'console' \| 'panel'` | No | Debug output mode |
|
|
@@ -30,7 +30,7 @@ interface ILiquidCommerceElementsConfig {
|
|
|
30
30
|
| `proxy` | `IElementsProxyConfig` | No | Proxy configuration for API requests |
|
|
31
31
|
| `development` | `ILiquidCommerceElementsDevelopmentConfig` | No | Development/testing options |
|
|
32
32
|
|
|
33
|
-
> **Note:** `debugMode` (`'console'` or `'panel'`) is **ignored in production** -- it is forced off when `env` is `'production'`. It only takes effect
|
|
33
|
+
> **Note:** `debugMode` (`'console'` or `'panel'`) is **ignored in production** -- it is forced off when `env` is `'production'`. It only takes effect outside production (`'staging'`).
|
|
34
34
|
|
|
35
35
|
---
|
|
36
36
|
|
|
@@ -379,7 +379,7 @@ Enable debug mode for detailed logging:
|
|
|
379
379
|
|
|
380
380
|
```javascript
|
|
381
381
|
const client = await Elements('YOUR_API_KEY', {
|
|
382
|
-
env: '
|
|
382
|
+
env: 'staging',
|
|
383
383
|
debugMode: 'console' // or 'panel'
|
|
384
384
|
});
|
|
385
385
|
```
|
|
@@ -409,9 +409,9 @@ Your API key is used for authentication but has limited privileges:
|
|
|
409
409
|
Use different API keys per environment:
|
|
410
410
|
|
|
411
411
|
```javascript
|
|
412
|
-
//
|
|
413
|
-
const client = await Elements('
|
|
414
|
-
env: '
|
|
412
|
+
// Staging
|
|
413
|
+
const client = await Elements('staging_key_abc123', {
|
|
414
|
+
env: 'staging'
|
|
415
415
|
});
|
|
416
416
|
|
|
417
417
|
// Production
|
|
@@ -46,7 +46,7 @@ The path segment selects which bundle is served:
|
|
|
46
46
|
|-----------|----------|-------------|
|
|
47
47
|
| `data-liquid-commerce-elements` | Yes | Identifies this as the Elements SDK script |
|
|
48
48
|
| `data-token` | Yes | Your LiquidCommerce API key |
|
|
49
|
-
| `data-env` | No | Environment: `
|
|
49
|
+
| `data-env` | No | Environment: `staging` or `production`. Defaults to `production` if omitted. |
|
|
50
50
|
| `defer` | Recommended | Allows non-blocking script loading |
|
|
51
51
|
|
|
52
52
|
### Where to Place the Script
|
|
@@ -264,7 +264,7 @@ The SDK accepts a configuration object during initialization:
|
|
|
264
264
|
|
|
265
265
|
```javascript
|
|
266
266
|
const client = await Elements('YOUR_API_KEY', {
|
|
267
|
-
env: 'production', // Optional (defaults to 'production'): '
|
|
267
|
+
env: 'production', // Optional (defaults to 'production'): 'staging' | 'production'
|
|
268
268
|
debugMode: 'console', // Optional: 'none' | 'console' | 'panel'
|
|
269
269
|
customTheme: { /* ... */ }, // Optional: Theme customization
|
|
270
270
|
promoTicker: [ /* ... */ ], // Optional: Promo ticker configuration
|
|
@@ -274,7 +274,7 @@ const client = await Elements('YOUR_API_KEY', {
|
|
|
274
274
|
});
|
|
275
275
|
```
|
|
276
276
|
|
|
277
|
-
> **Note:** `debugMode` is ignored when `env` is `'production'`. Debug logging and the debug panel are only activated
|
|
277
|
+
> **Note:** `debugMode` is ignored when `env` is `'production'`. Debug logging and the debug panel are only activated outside production (`staging`).
|
|
278
278
|
|
|
279
279
|
See [Configuration Reference](../api/configuration.md) for complete configuration options.
|
|
280
280
|
|
|
@@ -269,20 +269,20 @@ Prevents ad blockers and protects API keys.
|
|
|
269
269
|
```javascript
|
|
270
270
|
const apiKey = process.env.NODE_ENV === 'production'
|
|
271
271
|
? 'prod_key_xyz'
|
|
272
|
-
: '
|
|
272
|
+
: 'staging_key_abc';
|
|
273
273
|
|
|
274
274
|
const client = await Elements(apiKey, {
|
|
275
|
-
env: process.env.NODE_ENV === 'production' ? 'production' : '
|
|
275
|
+
env: process.env.NODE_ENV === 'production' ? 'production' : 'staging'
|
|
276
276
|
});
|
|
277
277
|
```
|
|
278
278
|
|
|
279
279
|
## Testing
|
|
280
280
|
|
|
281
|
-
### Use
|
|
281
|
+
### Use Staging With Debug Options
|
|
282
282
|
|
|
283
283
|
```javascript
|
|
284
284
|
const client = await Elements('YOUR_API_KEY', {
|
|
285
|
-
env: '
|
|
285
|
+
env: 'staging',
|
|
286
286
|
debugMode: 'console', // or 'panel'
|
|
287
287
|
development: {
|
|
288
288
|
openShadowDom: true // Makes debugging easier
|
|
@@ -12,13 +12,12 @@ It coexists with a host site's own GTM — see [Coexisting With Your Own GTM](#c
|
|
|
12
12
|
|
|
13
13
|
## Supported Environments
|
|
14
14
|
|
|
15
|
-
GTM initialization and every event push are enabled in production and staging. When the SDK is running in
|
|
15
|
+
GTM initialization and every event push are enabled in production and staging. When the SDK is running in Builder mode, no container is loaded and no events are sent.
|
|
16
16
|
|
|
17
17
|
Events are suppressed when any of the following is true:
|
|
18
18
|
|
|
19
19
|
- `window` is undefined (server-side rendering).
|
|
20
20
|
- The SDK is running in Builder mode.
|
|
21
|
-
- The environment is `development`.
|
|
22
21
|
|
|
23
22
|
The environment defaults to `production` when none is provided, so a standard production embed is analytics-enabled out of the box; a staging embed is also analytics-enabled when server GTM config is enabled for the partner.
|
|
24
23
|
|
|
@@ -13,7 +13,7 @@ Telemetry is enabled **only** when both conditions are true:
|
|
|
13
13
|
|
|
14
14
|
In every other case it is **disabled** and no events are queued or sent:
|
|
15
15
|
|
|
16
|
-
- Non-production environments (e.
|
|
16
|
+
- Non-production environments (i.e. staging).
|
|
17
17
|
- A custom API URL / proxy is configured via `development.customApiUrl`.
|
|
18
18
|
- Internal telemetry errors are only logged to the console in non-production or when debugging is enabled — never sent.
|
|
19
19
|
|
package/package.json
CHANGED