@eldrajs/sdk 0.2.6 → 0.2.7
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/CHANGELOG.md +19 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.js +3 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -9,25 +9,44 @@ platform repository.
|
|
|
9
9
|
|
|
10
10
|
## Unreleased
|
|
11
11
|
|
|
12
|
+
- `analyticsTrackerScript`'s documentation no longer says events always reach the gateway; with
|
|
13
|
+
`eventOrigin` set they go to that first-party proxy.
|
|
14
|
+
|
|
15
|
+
## 0.2.6 — 2026-10-08
|
|
16
|
+
|
|
12
17
|
- Responsive images: `responsiveImage` returns `src`, `srcset`, `sizes`, `width` and `height` for
|
|
13
18
|
an `<img>` from any media URL or object the API returns; `imageSrcset`, `imageUrl`,
|
|
14
19
|
`imageVariantFor`, `isEldraImage` and `ELDRA_IMAGE_VARIANT_WIDTHS` are the parts. A bare media
|
|
15
20
|
URL serves 800 px, so a storefront rendering it as-is was soft on wide screens. External URLs
|
|
16
21
|
and formats the host does not resize come back unchanged. See `docs/images.md`.
|
|
17
22
|
|
|
23
|
+
## 0.2.5 — 2026-09-25
|
|
24
|
+
|
|
25
|
+
- `analyticsTrackerScript` builds the analytics tracker `<script>` attributes from the same
|
|
26
|
+
configuration as the client, so the script comes from the gateway the site reads from. Events go
|
|
27
|
+
there too, unless `eventOrigin` names a first-party proxy to send them through.
|
|
28
|
+
|
|
29
|
+
## 0.2.4 — 2026-09-23
|
|
30
|
+
|
|
18
31
|
- `checkout.handoffUrl` defaults to the hosted checkout at `https://checkout.eldra.app` (exported
|
|
19
32
|
as `DEFAULT_ELDRA_CHECKOUT_URL`) when the client uses the default API base URL, so a production
|
|
20
33
|
storefront no longer needs a checkout URL setting. `checkoutUrl` and the `ELDRA_CHECKOUT_URL` env
|
|
21
34
|
keys still override it; a client on any other gateway must still name its checkout.
|
|
22
35
|
|
|
36
|
+
## 0.2.3 — 2026-09-23
|
|
37
|
+
|
|
23
38
|
- `EldraHttpError.errorId` carries the problem's specific reason, such as `CART_NOT_FOUND` or
|
|
24
39
|
`CART_INSUFFICIENT_STOCK`. The docs told you to branch on `code` for these, but the gateway puts
|
|
25
40
|
them in `errorId`; `code` is only the category (`NOT_FOUND`, `CONFLICT`) and is unchanged.
|
|
26
41
|
|
|
42
|
+
## 0.2.2 — 2026-09-20
|
|
43
|
+
|
|
27
44
|
- Restore `previewToken` on the SDK client and Vite generator after the move from
|
|
28
45
|
`vue-ui-components`. Accepts a string or callback and sends `X-Preview-Token`; the generator
|
|
29
46
|
forwards it to both type endpoints without embedding it in generated files.
|
|
30
47
|
|
|
48
|
+
## 0.2.1 — 2026-09-16
|
|
49
|
+
|
|
31
50
|
- The Vite plugin writes `.eldra/web-studio/` beside the nearest `package.json` instead of Vite's
|
|
32
51
|
root; on Nuxt 4 the root is `app/`, and the folder landed there. A relative `outDir` is resolved
|
|
33
52
|
the same way.
|
package/dist/index.d.ts
CHANGED
|
@@ -62,8 +62,9 @@ interface EldraTrackerScript {
|
|
|
62
62
|
}
|
|
63
63
|
/**
|
|
64
64
|
* Builds the tracker `<script>` attributes from the same configuration the client uses, so the
|
|
65
|
-
*
|
|
66
|
-
* organisation id is configured, which is the case
|
|
65
|
+
* script comes from the gateway the site reads from and reports there, unless `eventOrigin` names a
|
|
66
|
+
* first-party proxy. Returns `undefined` when no organisation id is configured, which is the case
|
|
67
|
+
* in builds that should not report at all.
|
|
67
68
|
*/
|
|
68
69
|
export declare function analyticsTrackerScript(options?: EldraTrackerScriptOptions): EldraTrackerScript | undefined;
|
|
69
70
|
//#endregion
|
package/dist/index.js
CHANGED
|
@@ -50,8 +50,9 @@ function createOrderAccessTokens(options = {}) {
|
|
|
50
50
|
//#region src/tracker.ts
|
|
51
51
|
/**
|
|
52
52
|
* Builds the tracker `<script>` attributes from the same configuration the client uses, so the
|
|
53
|
-
*
|
|
54
|
-
* organisation id is configured, which is the case
|
|
53
|
+
* script comes from the gateway the site reads from and reports there, unless `eventOrigin` names a
|
|
54
|
+
* first-party proxy. Returns `undefined` when no organisation id is configured, which is the case
|
|
55
|
+
* in builds that should not report at all.
|
|
55
56
|
*/
|
|
56
57
|
function analyticsTrackerScript(options = {}) {
|
|
57
58
|
const orgId = resolveOrgId(options);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eldrajs/sdk",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.7",
|
|
4
4
|
"description": "Framework-free client for the Eldra Web Studio public storefront API: CMS, catalog, cart, checkout handoff, orders, inventory. Types generated from your gateway's OpenAPI document and CMS schemas at build time.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cms",
|