@mindful-web/marko-web-omeda-identity-x 1.85.5 → 1.85.6

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/README.md CHANGED
@@ -18,7 +18,7 @@ All configuration data must be passed to the middleware when loaded (See [Middle
18
18
  | `clientKey` | No | The Omeda client key (such as `client_orgc`.) *Required if sending deployment optIns via the underlying omeda package!* [marko-web-omeda docs](../marko-web-omeda)
19
19
  | `appId` | **Yes** | The Omeda application API read token
20
20
  | `inputId` | **Yes** | The Omeda application API write token
21
- | `rapidIdentProductId` | **Yes** | The Omeda identifier for a Website product (ProductType=7).
21
+ | `rapidIdentProductId` | No — **deprecated**, see [Website products](#website-products-do-not-use-rapididentproductid) | The Omeda identifier for a Website product (ProductType=7). Sends the product on **every** rapid identification, which cuts a duplicate Omeda order each time. Put the website product in the site's deduped opt-in hook instead. | _none_
22
22
  | `idxConfig` | **Yes** | An instance of the IdentityX configuration class (see [marko-web-identity-x#1](../marko-web-identity-x/config.js)) | _n/a_
23
23
  | `idxRouteTemplates` | **Yes** | An object containing the Marko templates to use for each IdentityX endpoint. (see [marko-web-identity-x#2](../marko-web-identity-x/index.js))
24
24
  | `omedaPromoCodeCookieName` | No | The name of the cookie to look for a persisted/original promo code. | `omeda_promo_code` |
@@ -38,6 +38,67 @@ All configuration data must be passed to the middleware when loaded (See [Middle
38
38
  | `appendPromoCodeToHook[].hook` | | The name of the hook, such as `onLoginLinkSent`
39
39
  | `appendPromoCodeToHook[].promoCode` || The Omeda Promo Code (`String`) to append.
40
40
 
41
+ ### Website products: do not use `rapidIdentProductId`
42
+
43
+ `rapidIdentProductId` reads like site *identification* metadata, distinct from subscriptions. It
44
+ isn't. It is forwarded as `productId` to the rapid identification call, and in the omeda GraphQL
45
+ `rapidCustomerIdentification` resolver it is merged with `input.subscriptions` into a single
46
+ `Products` array on Save Customer and Order:
47
+
48
+ ```js
49
+ const productMap = new Map([...(input.productId ? [[input.productId, true]] : [])]);
50
+ // …
51
+ subscriptions.forEach(({ id, receive }) => {
52
+ subscriptionMap.set(id, receive);
53
+ if (!productMap.has(id)) productMap.set(id, receive);
54
+ });
55
+ // …
56
+ Products: [...productMap].map(([OmedaProductId, Receive]) => ({ … }))
57
+ ```
58
+
59
+ Omeda cuts an order for whatever lands in `Products`. So `rapidIdentProductId` orders the website
60
+ product on **every** identification — every login-link send, auth success and profile update — which
61
+ is a duplicate order per login, not a one-time attribution.
62
+
63
+ **Do this instead.** Leave `rapidIdentProductId` unset and list the website product in the site's
64
+ `identityXOptInHooks.onLoginLinkSent.productIds`. The site's `onLoginLinkSentFormatter` (in each
65
+ repo's `packages/global/config/omeda-identity-x.js`) filters those ids through this package's
66
+ [`getOmedaSubscriptionIds`](./omeda-data/get-omeda-subscription-ids.js) before building
67
+ `payload.appendSubscriptions`, so the product is ordered once — when the customer doesn't already
68
+ hold it — and every later identification is a no-op:
69
+
70
+ ```js
71
+ // sites/<site>/config/identity-x-opt-in-hooks.js
72
+ module.exports = {
73
+ onLoginLinkSent: {
74
+ productIds: [
75
+ 15375, // <Site> Website — deduped against the live Omeda record; ordered only when missing
76
+ ],
77
+ },
78
+ };
79
+ ```
80
+
81
+ ```js
82
+ // sites/<site>/config/omeda-identity-x.js — no `rapidIdentProductId`
83
+ module.exports = configure({ omedaConfig, idxConfig, websiteBehaviorAttributeId, omedaPromoCodePrefix });
84
+ ```
85
+
86
+ The website product still belongs on the customer's record — it just needs to get there once. The
87
+ field is retained for backwards compatibility and is optional in the Joi schema; it should not be
88
+ set on new sites.
89
+
90
+ History: the duplicate orders were found and fixed on allured (allured-business-media-websites#395,
91
+ Oct 2025) and the placement was rolled out fleet-wide through Aug 2026 (ab-media-websites#539,
92
+ ironmarkets-websites#993, cox-matthews-associates-websites#534, fusable-websites#1040,
93
+ watt-global-media-websites#731, industrial-media-websites#623). This README previously listed the
94
+ field as **required** and did not document the hook at all, which is what led two of those PRs to
95
+ initially move the ids the wrong way.
96
+
97
+ A related trap when reading site configs: some repos' `onAuthenticationSuccess.productIds` hold
98
+ **deployment type** ids despite the key name, because that formatter matches
99
+ `product.deploymentTypeId` and emits `deploymentTypes`. Check which formatter consumes a list before
100
+ assuming its ids are products.
101
+
41
102
  ### Customer re-sync interval
42
103
 
43
104
  `userResyncIntervalMs` is read from the **IdentityX** config (`idxConfig`), not from the properties
@@ -2,7 +2,7 @@
2
2
  "use strict";
3
3
 
4
4
  var marko_template = module.exports = require("marko/dist/html").t(__filename),
5
- marko_componentType = "/@mindful-web/marko-web-omeda-identity-x$1.85.5/components/identify.marko",
5
+ marko_componentType = "/@mindful-web/marko-web-omeda-identity-x$1.85.6/components/identify.marko",
6
6
  marko_component = require("./identify.marko"),
7
7
  marko_renderer = require("marko/dist/runtime/components/renderer"),
8
8
  module_getCookieId = require("@mindful-web/marko-web-omeda-identity-x/utils/get-cookie-id"),
@@ -51,7 +51,7 @@ marko_template._ = marko_renderer(render, {
51
51
  }, marko_component);
52
52
 
53
53
  marko_template.meta = {
54
- id: "/@mindful-web/marko-web-omeda-identity-x$1.85.5/components/identify.marko",
54
+ id: "/@mindful-web/marko-web-omeda-identity-x$1.85.6/components/identify.marko",
55
55
  component: "./identify.marko",
56
56
  tags: [
57
57
  "@mindful-web/marko-web-identity-x/components/identify.marko",
package/index.js CHANGED
@@ -45,7 +45,11 @@ const schemas = require('./validation/schemas');
45
45
  * @prop {?Promise<object>} onLoginLinkSentFormatter
46
46
  * @prop {?Promise<object>} onAuthenticationSuccessFormatter
47
47
  * @prop {?Promise<object>} onUserProfileUpdateFormatter
48
- * @prop {number} rapidIdentProductId
48
+ * @prop {?number} rapidIdentProductId **Deprecated.** Sends this website product on _every_ rapid
49
+ * identification, which cuts a duplicate Omeda order each time — the resolver merges it into the
50
+ * same `Products` array as `subscriptions`. Leave unset and put the website product in the site's
51
+ * `identityXOptInHooks.onLoginLinkSent.productIds`, which is deduped against the live customer
52
+ * record via `getOmedaSubscriptionIds`. Retained for backwards compatibility only; see README.
49
53
  *
50
54
  * @typedef BehaviorSchema
51
55
  * @prop {number} logIn
@@ -194,6 +198,17 @@ module.exports = (app, params = {}) => {
194
198
  rapidIdentProductId: Joi.number(),
195
199
  }), params);
196
200
 
201
+ // `rapidIdentProductId` is deprecated: the omeda `rapidCustomerIdentification` resolver merges it
202
+ // into the same SCAO `Products` array as `subscriptions`, so setting it orders the website
203
+ // product on every identification rather than once. Deliberately `console.warn` over the `warn`
204
+ // util, matching `resolveDurationMS`: this needs to be visible in production, which is where a
205
+ // reintroduced value would quietly start cutting duplicate orders again. No fleet repo sets it as
206
+ // of Aug 2026, so this should never fire outside of a regression.
207
+ if (rapidIdentProductId != null) {
208
+ // eslint-disable-next-line no-console
209
+ console.warn(`[config] rapidIdentProductId (${rapidIdentProductId}) is deprecated for brand ${brandKey}: it orders this website product on EVERY rapid identification, creating duplicate Omeda orders. Move it to the site's identityXOptInHooks.onLoginLinkSent.productIds, which is deduped against the live customer record. See @mindful-web/marko-web-omeda-identity-x README.`);
210
+ }
211
+
197
212
  // strip `oly_enc_id` when identity-x user is logged-in
198
213
  app.use(stripOlyticsParam());
199
214
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mindful-web/marko-web-omeda-identity-x",
3
- "version": "1.85.5",
3
+ "version": "1.85.6",
4
4
  "description": "Marko Omeda+IdentityX integration tools",
5
5
  "repository": "https://github.com/parameter1/mindful-web/tree/main/packages/marko-web-omeda-identity-x",
6
6
  "author": "Josh Worden <josh@parameter1.com>",
@@ -33,5 +33,5 @@
33
33
  "chai": "^4.3.7",
34
34
  "mocha": "^6.2.3"
35
35
  },
36
- "gitHead": "26553d897cb2c39e798031e4e2727a81123b1402"
36
+ "gitHead": "189d80823090e82c78aaca54dbe2209dbb230fa0"
37
37
  }