@walkeros/web-destination-hotjar 4.7.2 → 4.8.0-next-1791441510508

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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # @walkeros/web-destination-hotjar
2
2
 
3
+ ## 4.8.0-next-1791441510508
4
+
5
+ ### Patch Changes
6
+
7
+ - 5593d7b: Step examples that run with destination settings now name them in
8
+ their description (`settings.identify`, `settings.consent`), because the docs
9
+ show only an example's event, mapping and output, not the settings it runs
10
+ with.
11
+ - Updated dependencies [5593d7b]
12
+ - @walkeros/core@4.8.0-next-1791441510508
13
+ - @walkeros/web-core@4.8.0-next-1791441510508
14
+
3
15
  ## 4.7.2
4
16
 
5
17
  ### Patch Changes
package/README.md CHANGED
@@ -32,7 +32,11 @@ npm install @walkeros/web-destination-hotjar
32
32
  "destinations": {
33
33
  "hotjar": {
34
34
  "package": "@walkeros/web-destination-hotjar",
35
- "config": {}
35
+ "config": {
36
+ "settings": {
37
+ "siteId": 1234567
38
+ }
39
+ }
36
40
  }
37
41
  }
38
42
  }
package/dist/dev.js CHANGED
@@ -1 +1 @@
1
- "use strict";var e,t=Object.defineProperty,i=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,r=(e,i)=>{for(var n in i)t(e,n,{get:i[n],enumerable:!0})},o={};r(o,{examples:()=>v,schemas:()=>s}),module.exports=(e=o,((e,r,o,s)=>{if(r&&"object"==typeof r||"function"==typeof r)for(let d of n(r))a.call(e,d)||d===o||t(e,d,{get:()=>r[d],enumerable:!(s=i(r,d))||s.enumerable});return e})(t({},"__esModule",{value:!0}),e));var s={};r(s,{MappingSchema:()=>c,SettingsSchema:()=>u,mapping:()=>g,settings:()=>m});var d=require("@walkeros/core/dev"),p=require("@walkeros/core/dev"),u=p.z.object({siteId:p.z.number().int().positive().describe("Your Hotjar site ID (e.g. 1234567). Find it in your Hotjar dashboard under Settings."),hotjarVersion:p.z.number().int().positive().describe("Hotjar snippet version. Defaults to 6 (current). Override only if Hotjar releases a new version.").optional(),debug:p.z.boolean().describe("Enable Hotjar debug mode for development troubleshooting.").optional(),nonce:p.z.string().describe("CSP nonce for the injected Hotjar script tag. Required when using strict Content-Security-Policy.").optional(),identify:p.z.unknown().describe("walkerOS mapping value resolving to { userId, ...attributes } for Hotjar.identify(). userId is extracted as the first argument; remaining keys become user attributes.").optional()}),l=require("@walkeros/core/dev"),c=l.z.object({identify:l.z.unknown().describe("Per-event identity mapping. Resolves to { userId, ...attributes } -> Hotjar.identify(userId, attributes).").optional(),stateChange:l.z.unknown().describe("SPA route change notification. Resolves to a relative path string -> Hotjar.stateChange(path). Used for accurate heatmaps on virtual page views.").optional()}),m=(0,d.zodToSchema)(u),g=(0,d.zodToSchema)(c),v={};r(v,{env:()=>h,step:()=>w});var h={};r(h,{init:()=>j,push:()=>b,simulation:()=>y});var f=()=>!0,j={hotjar:{init:f,event:f,identify:f,stateChange:f,isReady:()=>!1}},b={hotjar:{init:f,event:f,identify:f,stateChange:f,isReady:()=>!0}},y=["call:hotjar.init","call:hotjar.event","call:hotjar.identify","call:hotjar.stateChange"],w={};r(w,{combinedFeatures:()=>O,defaultEventForwarding:()=>S,destinationLevelIdentify:()=>z,pageViewSilent:()=>P,pageViewStateChange:()=>E,renamedEvent:()=>C,userLoginIdentify:()=>k,wildcardIgnored:()=>I});var H=require("@walkeros/core"),S={title:"Default event",description:"A walker event becomes a Hotjar.event call with the event name as the custom Hotjar event.",in:(0,H.getEvent)("product view",{timestamp:1700000100}),out:[["hotjar.event","product view"]]},I={public:!1,in:(0,H.getEvent)("debug noise",{timestamp:1700000101}),mapping:{ignore:!0},out:[]},C={title:"Renamed event",description:"A mapping renames the event so the Hotjar custom event uses a canonical name like completed_purchase.",in:(0,H.getEvent)("order complete",{timestamp:1700000102}),mapping:{name:"completed_purchase"},out:[["hotjar.event","completed_purchase"]]},k={title:"User login identify",description:"A user login fires Hotjar.identify with userId and attributes before firing the event.",in:(0,H.getEvent)("user login",{timestamp:1700000103,data:{id:"u-123",email:"jane@example.com",plan:"premium"}}),mapping:{settings:{identify:{map:{userId:"data.id",email:"data.email",plan:"data.plan"}}}},out:[["hotjar.identify","u-123",{email:"jane@example.com",plan:"premium"}],["hotjar.event","user login"]]},z={title:"Destination identify",description:"Destination-level identify calls Hotjar.identify with the user id on every push as Hotjar recommends.",in:(0,H.getEvent)("page view",{timestamp:1700000104}),settings:{identify:{map:{userId:"user.id"}}},out:[["hotjar.identify","us3r",{}],["hotjar.event","page view"]]},E={title:"State change",description:"An SPA navigation fires Hotjar.stateChange with the new path instead of a Hotjar custom event.",in:(0,H.getEvent)("page view",{timestamp:1700000105}),mapping:{silent:!0,settings:{stateChange:"data.id"}},out:[["hotjar.stateChange","/docs/"]]},O={title:"Combined features",description:"A purchase fires Hotjar.identify then the renamed custom event in the canonical execution order.",in:(0,H.getEvent)("order complete",{timestamp:1700000106}),mapping:{name:"completed_purchase",settings:{identify:{map:{userId:"user.id"}}}},out:[["hotjar.identify","us3r",{}],["hotjar.event","completed_purchase"]]},P={public:!1,in:(0,H.getEvent)("page view",{timestamp:1700000107}),mapping:{silent:!0},out:[]};//# sourceMappingURL=dev.js.map
1
+ "use strict";var e,t=Object.defineProperty,i=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,r=(e,i)=>{for(var n in i)t(e,n,{get:i[n],enumerable:!0})},o={};r(o,{examples:()=>h,schemas:()=>s}),module.exports=(e=o,((e,r,o,s)=>{if(r&&"object"==typeof r||"function"==typeof r)for(let d of n(r))a.call(e,d)||d===o||t(e,d,{get:()=>r[d],enumerable:!(s=i(r,d))||s.enumerable});return e})(t({},"__esModule",{value:!0}),e));var s={};r(s,{MappingSchema:()=>c,SettingsSchema:()=>u,mapping:()=>g,settings:()=>m});var d=require("@walkeros/core/dev"),p=require("@walkeros/core/dev"),u=p.z.object({siteId:p.z.number().int().positive().describe("Your Hotjar site ID (e.g. 1234567). Find it in your Hotjar dashboard under Settings."),hotjarVersion:p.z.number().int().positive().describe("Hotjar snippet version. Defaults to 6 (current). Override only if Hotjar releases a new version.").optional(),debug:p.z.boolean().describe("Enable Hotjar debug mode for development troubleshooting.").optional(),nonce:p.z.string().describe("CSP nonce for the injected Hotjar script tag. Required when using strict Content-Security-Policy.").optional(),identify:p.z.unknown().describe("walkerOS mapping value resolving to { userId, ...attributes } for Hotjar.identify(). userId is extracted as the first argument; remaining keys become user attributes.").optional()}),l=require("@walkeros/core/dev"),c=l.z.object({identify:l.z.unknown().describe("Per-event identity mapping. Resolves to { userId, ...attributes } -> Hotjar.identify(userId, attributes).").optional(),stateChange:l.z.unknown().describe("SPA route change notification. Resolves to a relative path string -> Hotjar.stateChange(path). Used for accurate heatmaps on virtual page views.").optional()}),m=(0,d.zodToSchema)(u),g=(0,d.zodToSchema)(c),h={};r(h,{env:()=>v,step:()=>w});var v={};r(v,{init:()=>j,push:()=>b,simulation:()=>y});var f=()=>!0,j={hotjar:{init:f,event:f,identify:f,stateChange:f,isReady:()=>!1}},b={hotjar:{init:f,event:f,identify:f,stateChange:f,isReady:()=>!0}},y=["call:hotjar.init","call:hotjar.event","call:hotjar.identify","call:hotjar.stateChange"],w={};r(w,{combinedFeatures:()=>O,defaultEventForwarding:()=>I,destinationLevelIdentify:()=>z,pageViewSilent:()=>P,pageViewStateChange:()=>E,renamedEvent:()=>C,userLoginIdentify:()=>k,wildcardIgnored:()=>S});var H=require("@walkeros/core"),I={title:"Default event",description:"A walker event becomes a Hotjar.event call with the event name as the custom Hotjar event.",in:(0,H.getEvent)("product view",{timestamp:1700000100}),out:[["hotjar.event","product view"]]},S={public:!1,in:(0,H.getEvent)("debug noise",{timestamp:1700000101}),mapping:{ignore:!0},out:[]},C={title:"Renamed event",description:"A mapping renames the event so the Hotjar custom event uses a canonical name like completed_purchase.",in:(0,H.getEvent)("order complete",{timestamp:1700000102}),mapping:{name:"completed_purchase"},out:[["hotjar.event","completed_purchase"]]},k={title:"User login identify",description:"A user login fires Hotjar.identify with userId and attributes before firing the event.",in:(0,H.getEvent)("user login",{timestamp:1700000103,data:{id:"u-123",email:"jane@example.com",plan:"premium"}}),mapping:{settings:{identify:{map:{userId:"data.id",email:"data.email",plan:"data.plan"}}}},out:[["hotjar.identify","u-123",{email:"jane@example.com",plan:"premium"}],["hotjar.event","user login"]]},z={title:"Destination identify",description:"With settings.identify mapping userId to 'user.id', the destination calls Hotjar.identify on every push, as Hotjar recommends, before the event.",in:(0,H.getEvent)("page view",{timestamp:1700000104}),settings:{identify:{map:{userId:"user.id"}}},out:[["hotjar.identify","us3r",{}],["hotjar.event","page view"]]},E={title:"State change",description:"An SPA navigation fires Hotjar.stateChange with the new path instead of a Hotjar custom event.",in:(0,H.getEvent)("page view",{timestamp:1700000105}),mapping:{silent:!0,settings:{stateChange:"data.id"}},out:[["hotjar.stateChange","/docs/"]]},O={title:"Combined features",description:"A purchase fires Hotjar.identify then the renamed custom event in the canonical execution order.",in:(0,H.getEvent)("order complete",{timestamp:1700000106}),mapping:{name:"completed_purchase",settings:{identify:{map:{userId:"user.id"}}}},out:[["hotjar.identify","us3r",{}],["hotjar.event","completed_purchase"]]},P={public:!1,in:(0,H.getEvent)("page view",{timestamp:1700000107}),mapping:{silent:!0},out:[]};//# sourceMappingURL=dev.js.map
package/dist/dev.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/dev.ts","../src/schemas/index.ts","../src/schemas/settings.ts","../src/schemas/mapping.ts","../src/examples/index.ts","../src/examples/env.ts","../src/examples/step.ts"],"sourcesContent":["export * as schemas from './schemas';\nexport * as examples from './examples';\n","import { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema } from './settings';\nimport { MappingSchema } from './mapping';\n\nexport { SettingsSchema, type Settings } from './settings';\nexport { MappingSchema, type Mapping } from './mapping';\n\n// JSON Schema\nexport const settings = zodToSchema(SettingsSchema);\nexport const mapping = zodToSchema(MappingSchema);\n","import { z } from '@walkeros/core/dev';\n\nexport const SettingsSchema = z.object({\n siteId: z\n .number()\n .int()\n .positive()\n .describe(\n 'Your Hotjar site ID (e.g. 1234567). Find it in your Hotjar dashboard under Settings.',\n ),\n hotjarVersion: z\n .number()\n .int()\n .positive()\n .describe(\n 'Hotjar snippet version. Defaults to 6 (current). Override only if Hotjar releases a new version.',\n )\n .optional(),\n debug: z\n .boolean()\n .describe('Enable Hotjar debug mode for development troubleshooting.')\n .optional(),\n nonce: z\n .string()\n .describe(\n 'CSP nonce for the injected Hotjar script tag. Required when using strict Content-Security-Policy.',\n )\n .optional(),\n identify: z\n .unknown()\n .describe(\n 'walkerOS mapping value resolving to { userId, ...attributes } for Hotjar.identify(). userId is extracted as the first argument; remaining keys become user attributes.',\n )\n .optional(),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\nexport const MappingSchema = z.object({\n identify: z\n .unknown()\n .describe(\n 'Per-event identity mapping. Resolves to { userId, ...attributes } -> Hotjar.identify(userId, attributes).',\n )\n .optional(),\n stateChange: z\n .unknown()\n .describe(\n 'SPA route change notification. Resolves to a relative path string -> Hotjar.stateChange(path). Used for accurate heatmaps on virtual page views.',\n )\n .optional(),\n});\n\nexport type Mapping = z.infer<typeof MappingSchema>;\n","export * as env from './env';\nexport * as step from './step';\n","import type { Env } from '../types';\n\n/**\n * Example environment configurations for Hotjar destination.\n *\n * Tests clone `push` and replace individual methods with jest spies.\n * Production leaves `env.hotjar` undefined -- the destination falls back\n * to the real `@hotjar/browser` default export.\n */\n\nconst noop = (() => true) as (...args: unknown[]) => boolean;\n\n/**\n * Pre-init environment -- Hotjar SDK methods are no-ops until init wires them.\n */\nexport const init: Env | undefined = {\n hotjar: {\n init: noop as HotjarInit,\n event: noop,\n identify: noop as HotjarIdentify,\n stateChange: noop,\n isReady: () => false,\n },\n};\n\n/**\n * Post-init environment -- Hotjar SDK methods are spy-able no-ops.\n * Tests clone this and replace individual methods with jest.fn() for assertions.\n */\nexport const push: Env = {\n hotjar: {\n init: noop as HotjarInit,\n event: noop,\n identify: noop as HotjarIdentify,\n stateChange: noop,\n isReady: () => true,\n },\n};\n\n/**\n * Simulation tracking paths for CLI --simulate\n */\nexport const simulation = [\n 'call:hotjar.init',\n 'call:hotjar.event',\n 'call:hotjar.identify',\n 'call:hotjar.stateChange',\n];\n\n// Local helper types to narrow the generic `noop` to the specific SDK\n// signatures without loose casts.\ntype HotjarInit = NonNullable<Env['hotjar']>['init'];\ntype HotjarIdentify = NonNullable<Env['hotjar']>['identify'];\n","import type { Flow } from '@walkeros/core';\nimport { getEvent } from '@walkeros/core';\nimport type { Settings } from '../types';\n\n/**\n * Extended step example allowing destination-level settings overrides.\n */\nexport type HotjarStepExample = Flow.StepExample & {\n settings?: Partial<Settings>;\n};\n\n/**\n * Default event forwarding -- every walkerOS event becomes Hotjar.event(name).\n * No mapping rule; the destination's default push behavior fires.\n */\nexport const defaultEventForwarding: HotjarStepExample = {\n title: 'Default event',\n description:\n 'A walker event becomes a Hotjar.event call with the event name as the custom Hotjar event.',\n in: getEvent('product view', { timestamp: 1700000100 }),\n out: [['hotjar.event', 'product view']],\n};\n\n/**\n * Wildcard ignore pattern -- suppresses noisy events.\n * The destination must produce zero calls.\n */\nexport const wildcardIgnored: HotjarStepExample = {\n public: false,\n in: getEvent('debug noise', { timestamp: 1700000101 }),\n mapping: { ignore: true },\n out: [],\n};\n\n/**\n * Renamed event via mapping.name -- order complete becomes completed_purchase.\n */\nexport const renamedEvent: HotjarStepExample = {\n title: 'Renamed event',\n description:\n 'A mapping renames the event so the Hotjar custom event uses a canonical name like completed_purchase.',\n in: getEvent('order complete', { timestamp: 1700000102 }),\n mapping: {\n name: 'completed_purchase',\n },\n out: [['hotjar.event', 'completed_purchase']],\n};\n\n/**\n * Per-event identity via mapping.settings.identify.\n * Resolves { userId, ...attributes } -> Hotjar.identify(userId, attributes).\n * Identify fires before event per Hotjar's guidance.\n */\nexport const userLoginIdentify: HotjarStepExample = {\n title: 'User login identify',\n description:\n 'A user login fires Hotjar.identify with userId and attributes before firing the event.',\n in: getEvent('user login', {\n timestamp: 1700000103,\n data: { id: 'u-123', email: 'jane@example.com', plan: 'premium' },\n }),\n mapping: {\n settings: {\n identify: {\n map: {\n userId: 'data.id',\n email: 'data.email',\n plan: 'data.plan',\n },\n },\n },\n },\n out: [\n [\n 'hotjar.identify',\n 'u-123',\n { email: 'jane@example.com', plan: 'premium' },\n ],\n ['hotjar.event', 'user login'],\n ],\n};\n\n/**\n * Destination-level settings.identify -- fires on every push.\n * Hotjar recommends calling identify() on every page load.\n */\nexport const destinationLevelIdentify: HotjarStepExample = {\n title: 'Destination identify',\n description:\n 'Destination-level identify calls Hotjar.identify with the user id on every push as Hotjar recommends.',\n in: getEvent('page view', { timestamp: 1700000104 }),\n settings: {\n identify: {\n map: {\n userId: 'user.id',\n },\n },\n },\n out: [\n ['hotjar.identify', 'us3r', {}],\n ['hotjar.event', 'page view'],\n ],\n};\n\n/**\n * SPA state change -- stateChange mapping resolves to path string.\n * silent=true suppresses the default Hotjar.event() call.\n */\nexport const pageViewStateChange: HotjarStepExample = {\n title: 'State change',\n description:\n 'An SPA navigation fires Hotjar.stateChange with the new path instead of a Hotjar custom event.',\n in: getEvent('page view', { timestamp: 1700000105 }),\n mapping: {\n silent: true,\n settings: {\n stateChange: 'data.id',\n },\n },\n out: [['hotjar.stateChange', '/docs/']],\n};\n\n/**\n * Combined features -- identify + renamed event on the same push.\n * Execution order: identify -> event.\n */\nexport const combinedFeatures: HotjarStepExample = {\n title: 'Combined features',\n description:\n 'A purchase fires Hotjar.identify then the renamed custom event in the canonical execution order.',\n in: getEvent('order complete', { timestamp: 1700000106 }),\n mapping: {\n name: 'completed_purchase',\n settings: {\n identify: { map: { userId: 'user.id' } },\n },\n },\n out: [\n ['hotjar.identify', 'us3r', {}],\n ['hotjar.event', 'completed_purchase'],\n ],\n};\n\n/**\n * mapping.silent -- suppresses the default Hotjar.event() call. No other\n * settings active, so the destination produces zero calls.\n */\nexport const pageViewSilent: HotjarStepExample = {\n public: false,\n in: getEvent('page view', { timestamp: 1700000107 }),\n mapping: {\n silent: true,\n },\n out: [],\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAA,cAA4B;;;ACA5B,iBAAkB;AAEX,IAAM,iBAAiB,aAAE,OAAO;AAAA,EACrC,QAAQ,aACL,OAAO,EACP,IAAI,EACJ,SAAS,EACT;AAAA,IACC;AAAA,EACF;AAAA,EACF,eAAe,aACZ,OAAO,EACP,IAAI,EACJ,SAAS,EACT;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,OAAO,aACJ,QAAQ,EACR,SAAS,2DAA2D,EACpE,SAAS;AAAA,EACZ,OAAO,aACJ,OAAO,EACP;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,UAAU,aACP,QAAQ,EACR;AAAA,IACC;AAAA,EACF,EACC,SAAS;AACd,CAAC;;;AClCD,IAAAC,cAAkB;AAEX,IAAM,gBAAgB,cAAE,OAAO;AAAA,EACpC,UAAU,cACP,QAAQ,EACR;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,aAAa,cACV,QAAQ,EACR;AAAA,IACC;AAAA,EACF,EACC,SAAS;AACd,CAAC;;;AFPM,IAAM,eAAW,yBAAY,cAAc;AAC3C,IAAM,cAAU,yBAAY,aAAa;;;AGThD;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUA,IAAM,QAAQ,MAAM;AAKb,IAAM,OAAwB;AAAA,EACnC,QAAQ;AAAA,IACN,MAAM;AAAA,IACN,OAAO;AAAA,IACP,UAAU;AAAA,IACV,aAAa;AAAA,IACb,SAAS,MAAM;AAAA,EACjB;AACF;AAMO,IAAM,OAAY;AAAA,EACvB,QAA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index.ts","../src/schemas/settings.ts","../src/schemas/mapping.ts","../src/examples/index.ts","../src/examples/env.ts","../src/examples/step.ts"],"sourcesContent":["export * as schemas from './schemas';\nexport * as examples from './examples';\n","import { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema } from './settings';\nimport { MappingSchema } from './mapping';\n\nexport { SettingsSchema, type Settings } from './settings';\nexport { MappingSchema, type Mapping } from './mapping';\n\n// JSON Schema\nexport const settings = zodToSchema(SettingsSchema);\nexport const mapping = zodToSchema(MappingSchema);\n","import { z } from '@walkeros/core/dev';\n\nexport const SettingsSchema = z.object({\n siteId: z\n .number()\n .int()\n .positive()\n .describe(\n 'Your Hotjar site ID (e.g. 1234567). Find it in your Hotjar dashboard under Settings.',\n ),\n hotjarVersion: z\n .number()\n .int()\n .positive()\n .describe(\n 'Hotjar snippet version. Defaults to 6 (current). Override only if Hotjar releases a new version.',\n )\n .optional(),\n debug: z\n .boolean()\n .describe('Enable Hotjar debug mode for development troubleshooting.')\n .optional(),\n nonce: z\n .string()\n .describe(\n 'CSP nonce for the injected Hotjar script tag. Required when using strict Content-Security-Policy.',\n )\n .optional(),\n identify: z\n .unknown()\n .describe(\n 'walkerOS mapping value resolving to { userId, ...attributes } for Hotjar.identify(). userId is extracted as the first argument; remaining keys become user attributes.',\n )\n .optional(),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\nexport const MappingSchema = z.object({\n identify: z\n .unknown()\n .describe(\n 'Per-event identity mapping. Resolves to { userId, ...attributes } -> Hotjar.identify(userId, attributes).',\n )\n .optional(),\n stateChange: z\n .unknown()\n .describe(\n 'SPA route change notification. Resolves to a relative path string -> Hotjar.stateChange(path). Used for accurate heatmaps on virtual page views.',\n )\n .optional(),\n});\n\nexport type Mapping = z.infer<typeof MappingSchema>;\n","export * as env from './env';\nexport * as step from './step';\n","import type { Env } from '../types';\n\n/**\n * Example environment configurations for Hotjar destination.\n *\n * Tests clone `push` and replace individual methods with jest spies.\n * Production leaves `env.hotjar` undefined -- the destination falls back\n * to the real `@hotjar/browser` default export.\n */\n\nconst noop = (() => true) as (...args: unknown[]) => boolean;\n\n/**\n * Pre-init environment -- Hotjar SDK methods are no-ops until init wires them.\n */\nexport const init: Env | undefined = {\n hotjar: {\n init: noop as HotjarInit,\n event: noop,\n identify: noop as HotjarIdentify,\n stateChange: noop,\n isReady: () => false,\n },\n};\n\n/**\n * Post-init environment -- Hotjar SDK methods are spy-able no-ops.\n * Tests clone this and replace individual methods with jest.fn() for assertions.\n */\nexport const push: Env = {\n hotjar: {\n init: noop as HotjarInit,\n event: noop,\n identify: noop as HotjarIdentify,\n stateChange: noop,\n isReady: () => true,\n },\n};\n\n/**\n * Simulation tracking paths for CLI --simulate\n */\nexport const simulation = [\n 'call:hotjar.init',\n 'call:hotjar.event',\n 'call:hotjar.identify',\n 'call:hotjar.stateChange',\n];\n\n// Local helper types to narrow the generic `noop` to the specific SDK\n// signatures without loose casts.\ntype HotjarInit = NonNullable<Env['hotjar']>['init'];\ntype HotjarIdentify = NonNullable<Env['hotjar']>['identify'];\n","import type { Flow } from '@walkeros/core';\nimport { getEvent } from '@walkeros/core';\nimport type { Settings } from '../types';\n\n/**\n * Extended step example allowing destination-level settings overrides.\n */\nexport type HotjarStepExample = Flow.StepExample & {\n settings?: Partial<Settings>;\n};\n\n/**\n * Default event forwarding -- every walkerOS event becomes Hotjar.event(name).\n * No mapping rule; the destination's default push behavior fires.\n */\nexport const defaultEventForwarding: HotjarStepExample = {\n title: 'Default event',\n description:\n 'A walker event becomes a Hotjar.event call with the event name as the custom Hotjar event.',\n in: getEvent('product view', { timestamp: 1700000100 }),\n out: [['hotjar.event', 'product view']],\n};\n\n/**\n * Wildcard ignore pattern -- suppresses noisy events.\n * The destination must produce zero calls.\n */\nexport const wildcardIgnored: HotjarStepExample = {\n public: false,\n in: getEvent('debug noise', { timestamp: 1700000101 }),\n mapping: { ignore: true },\n out: [],\n};\n\n/**\n * Renamed event via mapping.name -- order complete becomes completed_purchase.\n */\nexport const renamedEvent: HotjarStepExample = {\n title: 'Renamed event',\n description:\n 'A mapping renames the event so the Hotjar custom event uses a canonical name like completed_purchase.',\n in: getEvent('order complete', { timestamp: 1700000102 }),\n mapping: {\n name: 'completed_purchase',\n },\n out: [['hotjar.event', 'completed_purchase']],\n};\n\n/**\n * Per-event identity via mapping.settings.identify.\n * Resolves { userId, ...attributes } -> Hotjar.identify(userId, attributes).\n * Identify fires before event per Hotjar's guidance.\n */\nexport const userLoginIdentify: HotjarStepExample = {\n title: 'User login identify',\n description:\n 'A user login fires Hotjar.identify with userId and attributes before firing the event.',\n in: getEvent('user login', {\n timestamp: 1700000103,\n data: { id: 'u-123', email: 'jane@example.com', plan: 'premium' },\n }),\n mapping: {\n settings: {\n identify: {\n map: {\n userId: 'data.id',\n email: 'data.email',\n plan: 'data.plan',\n },\n },\n },\n },\n out: [\n [\n 'hotjar.identify',\n 'u-123',\n { email: 'jane@example.com', plan: 'premium' },\n ],\n ['hotjar.event', 'user login'],\n ],\n};\n\n/**\n * Destination-level settings.identify -- fires on every push.\n * Hotjar recommends calling identify() on every page load.\n */\nexport const destinationLevelIdentify: HotjarStepExample = {\n title: 'Destination identify',\n description:\n \"With settings.identify mapping userId to 'user.id', the destination calls Hotjar.identify on every push, as Hotjar recommends, before the event.\",\n in: getEvent('page view', { timestamp: 1700000104 }),\n settings: {\n identify: {\n map: {\n userId: 'user.id',\n },\n },\n },\n out: [\n ['hotjar.identify', 'us3r', {}],\n ['hotjar.event', 'page view'],\n ],\n};\n\n/**\n * SPA state change -- stateChange mapping resolves to path string.\n * silent=true suppresses the default Hotjar.event() call.\n */\nexport const pageViewStateChange: HotjarStepExample = {\n title: 'State change',\n description:\n 'An SPA navigation fires Hotjar.stateChange with the new path instead of a Hotjar custom event.',\n in: getEvent('page view', { timestamp: 1700000105 }),\n mapping: {\n silent: true,\n settings: {\n stateChange: 'data.id',\n },\n },\n out: [['hotjar.stateChange', '/docs/']],\n};\n\n/**\n * Combined features -- identify + renamed event on the same push.\n * Execution order: identify -> event.\n */\nexport const combinedFeatures: HotjarStepExample = {\n title: 'Combined features',\n description:\n 'A purchase fires Hotjar.identify then the renamed custom event in the canonical execution order.',\n in: getEvent('order complete', { timestamp: 1700000106 }),\n mapping: {\n name: 'completed_purchase',\n settings: {\n identify: { map: { userId: 'user.id' } },\n },\n },\n out: [\n ['hotjar.identify', 'us3r', {}],\n ['hotjar.event', 'completed_purchase'],\n ],\n};\n\n/**\n * mapping.silent -- suppresses the default Hotjar.event() call. No other\n * settings active, so the destination produces zero calls.\n */\nexport const pageViewSilent: HotjarStepExample = {\n public: false,\n in: getEvent('page view', { timestamp: 1700000107 }),\n mapping: {\n silent: true,\n },\n out: [],\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAA,cAA4B;;;ACA5B,iBAAkB;AAEX,IAAM,iBAAiB,aAAE,OAAO;AAAA,EACrC,QAAQ,aACL,OAAO,EACP,IAAI,EACJ,SAAS,EACT;AAAA,IACC;AAAA,EACF;AAAA,EACF,eAAe,aACZ,OAAO,EACP,IAAI,EACJ,SAAS,EACT;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,OAAO,aACJ,QAAQ,EACR,SAAS,2DAA2D,EACpE,SAAS;AAAA,EACZ,OAAO,aACJ,OAAO,EACP;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,UAAU,aACP,QAAQ,EACR;AAAA,IACC;AAAA,EACF,EACC,SAAS;AACd,CAAC;;;AClCD,IAAAC,cAAkB;AAEX,IAAM,gBAAgB,cAAE,OAAO;AAAA,EACpC,UAAU,cACP,QAAQ,EACR;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,aAAa,cACV,QAAQ,EACR;AAAA,IACC;AAAA,EACF,EACC,SAAS;AACd,CAAC;;;AF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,EACA,KAAK;AAAA,IACH,CAAC,mBAAmB,QAAQ,CAAC,CAAC;AAAA,IAC9B,CAAC,gBAAgB,oBAAoB;AAAA,EACvC;AACF;AAMO,IAAM,iBAAoC;AAAA,EAC/C,QAAQ;AAAA,EACR,QAAI,sBAAS,aAAa,EAAE,WAAW,WAAW,CAAC;AAAA,EACnD,SAAS;AAAA,IACP,QAAQ;AAAA,EACV;AAAA,EACA,KAAK,CAAC;AACR;","names":["import_dev","import_dev"]}
package/dist/dev.mjs CHANGED
@@ -1 +1 @@
1
- var e=Object.defineProperty,t=(t,i)=>{for(var a in i)e(t,a,{get:i[a],enumerable:!0})},i={};t(i,{MappingSchema:()=>s,SettingsSchema:()=>r,mapping:()=>p,settings:()=>d});import{zodToSchema as a}from"@walkeros/core/dev";import{z as n}from"@walkeros/core/dev";var r=n.object({siteId:n.number().int().positive().describe("Your Hotjar site ID (e.g. 1234567). Find it in your Hotjar dashboard under Settings."),hotjarVersion:n.number().int().positive().describe("Hotjar snippet version. Defaults to 6 (current). Override only if Hotjar releases a new version.").optional(),debug:n.boolean().describe("Enable Hotjar debug mode for development troubleshooting.").optional(),nonce:n.string().describe("CSP nonce for the injected Hotjar script tag. Required when using strict Content-Security-Policy.").optional(),identify:n.unknown().describe("walkerOS mapping value resolving to { userId, ...attributes } for Hotjar.identify(). userId is extracted as the first argument; remaining keys become user attributes.").optional()});import{z as o}from"@walkeros/core/dev";var s=o.object({identify:o.unknown().describe("Per-event identity mapping. Resolves to { userId, ...attributes } -> Hotjar.identify(userId, attributes).").optional(),stateChange:o.unknown().describe("SPA route change notification. Resolves to a relative path string -> Hotjar.stateChange(path). Used for accurate heatmaps on virtual page views.").optional()}),d=a(r),p=a(s),m={};t(m,{env:()=>l,step:()=>v});var l={};t(l,{init:()=>c,push:()=>h,simulation:()=>g});var u=()=>!0,c={hotjar:{init:u,event:u,identify:u,stateChange:u,isReady:()=>!1}},h={hotjar:{init:u,event:u,identify:u,stateChange:u,isReady:()=>!0}},g=["call:hotjar.init","call:hotjar.event","call:hotjar.identify","call:hotjar.stateChange"],v={};t(v,{combinedFeatures:()=>C,defaultEventForwarding:()=>j,destinationLevelIdentify:()=>H,pageViewSilent:()=>S,pageViewStateChange:()=>I,renamedEvent:()=>y,userLoginIdentify:()=>w,wildcardIgnored:()=>b});import{getEvent as f}from"@walkeros/core";var j={title:"Default event",description:"A walker event becomes a Hotjar.event call with the event name as the custom Hotjar event.",in:f("product view",{timestamp:1700000100}),out:[["hotjar.event","product view"]]},b={public:!1,in:f("debug noise",{timestamp:1700000101}),mapping:{ignore:!0},out:[]},y={title:"Renamed event",description:"A mapping renames the event so the Hotjar custom event uses a canonical name like completed_purchase.",in:f("order complete",{timestamp:1700000102}),mapping:{name:"completed_purchase"},out:[["hotjar.event","completed_purchase"]]},w={title:"User login identify",description:"A user login fires Hotjar.identify with userId and attributes before firing the event.",in:f("user login",{timestamp:1700000103,data:{id:"u-123",email:"jane@example.com",plan:"premium"}}),mapping:{settings:{identify:{map:{userId:"data.id",email:"data.email",plan:"data.plan"}}}},out:[["hotjar.identify","u-123",{email:"jane@example.com",plan:"premium"}],["hotjar.event","user login"]]},H={title:"Destination identify",description:"Destination-level identify calls Hotjar.identify with the user id on every push as Hotjar recommends.",in:f("page view",{timestamp:1700000104}),settings:{identify:{map:{userId:"user.id"}}},out:[["hotjar.identify","us3r",{}],["hotjar.event","page view"]]},I={title:"State change",description:"An SPA navigation fires Hotjar.stateChange with the new path instead of a Hotjar custom event.",in:f("page view",{timestamp:1700000105}),mapping:{silent:!0,settings:{stateChange:"data.id"}},out:[["hotjar.stateChange","/docs/"]]},C={title:"Combined features",description:"A purchase fires Hotjar.identify then the renamed custom event in the canonical execution order.",in:f("order complete",{timestamp:1700000106}),mapping:{name:"completed_purchase",settings:{identify:{map:{userId:"user.id"}}}},out:[["hotjar.identify","us3r",{}],["hotjar.event","completed_purchase"]]},S={public:!1,in:f("page view",{timestamp:1700000107}),mapping:{silent:!0},out:[]};export{m as examples,i as schemas};//# sourceMappingURL=dev.mjs.map
1
+ var e=Object.defineProperty,t=(t,i)=>{for(var a in i)e(t,a,{get:i[a],enumerable:!0})},i={};t(i,{MappingSchema:()=>s,SettingsSchema:()=>r,mapping:()=>p,settings:()=>d});import{zodToSchema as a}from"@walkeros/core/dev";import{z as n}from"@walkeros/core/dev";var r=n.object({siteId:n.number().int().positive().describe("Your Hotjar site ID (e.g. 1234567). Find it in your Hotjar dashboard under Settings."),hotjarVersion:n.number().int().positive().describe("Hotjar snippet version. Defaults to 6 (current). Override only if Hotjar releases a new version.").optional(),debug:n.boolean().describe("Enable Hotjar debug mode for development troubleshooting.").optional(),nonce:n.string().describe("CSP nonce for the injected Hotjar script tag. Required when using strict Content-Security-Policy.").optional(),identify:n.unknown().describe("walkerOS mapping value resolving to { userId, ...attributes } for Hotjar.identify(). userId is extracted as the first argument; remaining keys become user attributes.").optional()});import{z as o}from"@walkeros/core/dev";var s=o.object({identify:o.unknown().describe("Per-event identity mapping. Resolves to { userId, ...attributes } -> Hotjar.identify(userId, attributes).").optional(),stateChange:o.unknown().describe("SPA route change notification. Resolves to a relative path string -> Hotjar.stateChange(path). Used for accurate heatmaps on virtual page views.").optional()}),d=a(r),p=a(s),m={};t(m,{env:()=>u,step:()=>v});var u={};t(u,{init:()=>c,push:()=>h,simulation:()=>g});var l=()=>!0,c={hotjar:{init:l,event:l,identify:l,stateChange:l,isReady:()=>!1}},h={hotjar:{init:l,event:l,identify:l,stateChange:l,isReady:()=>!0}},g=["call:hotjar.init","call:hotjar.event","call:hotjar.identify","call:hotjar.stateChange"],v={};t(v,{combinedFeatures:()=>C,defaultEventForwarding:()=>j,destinationLevelIdentify:()=>H,pageViewSilent:()=>S,pageViewStateChange:()=>I,renamedEvent:()=>y,userLoginIdentify:()=>w,wildcardIgnored:()=>b});import{getEvent as f}from"@walkeros/core";var j={title:"Default event",description:"A walker event becomes a Hotjar.event call with the event name as the custom Hotjar event.",in:f("product view",{timestamp:1700000100}),out:[["hotjar.event","product view"]]},b={public:!1,in:f("debug noise",{timestamp:1700000101}),mapping:{ignore:!0},out:[]},y={title:"Renamed event",description:"A mapping renames the event so the Hotjar custom event uses a canonical name like completed_purchase.",in:f("order complete",{timestamp:1700000102}),mapping:{name:"completed_purchase"},out:[["hotjar.event","completed_purchase"]]},w={title:"User login identify",description:"A user login fires Hotjar.identify with userId and attributes before firing the event.",in:f("user login",{timestamp:1700000103,data:{id:"u-123",email:"jane@example.com",plan:"premium"}}),mapping:{settings:{identify:{map:{userId:"data.id",email:"data.email",plan:"data.plan"}}}},out:[["hotjar.identify","u-123",{email:"jane@example.com",plan:"premium"}],["hotjar.event","user login"]]},H={title:"Destination identify",description:"With settings.identify mapping userId to 'user.id', the destination calls Hotjar.identify on every push, as Hotjar recommends, before the event.",in:f("page view",{timestamp:1700000104}),settings:{identify:{map:{userId:"user.id"}}},out:[["hotjar.identify","us3r",{}],["hotjar.event","page view"]]},I={title:"State change",description:"An SPA navigation fires Hotjar.stateChange with the new path instead of a Hotjar custom event.",in:f("page view",{timestamp:1700000105}),mapping:{silent:!0,settings:{stateChange:"data.id"}},out:[["hotjar.stateChange","/docs/"]]},C={title:"Combined features",description:"A purchase fires Hotjar.identify then the renamed custom event in the canonical execution order.",in:f("order complete",{timestamp:1700000106}),mapping:{name:"completed_purchase",settings:{identify:{map:{userId:"user.id"}}}},out:[["hotjar.identify","us3r",{}],["hotjar.event","completed_purchase"]]},S={public:!1,in:f("page view",{timestamp:1700000107}),mapping:{silent:!0},out:[]};export{m as examples,i as schemas};//# sourceMappingURL=dev.mjs.map
package/dist/dev.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/schemas/index.ts","../src/schemas/settings.ts","../src/schemas/mapping.ts","../src/examples/index.ts","../src/examples/env.ts","../src/examples/step.ts"],"sourcesContent":["import { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema } from './settings';\nimport { MappingSchema } from './mapping';\n\nexport { SettingsSchema, type Settings } from './settings';\nexport { MappingSchema, type Mapping } from './mapping';\n\n// JSON Schema\nexport const settings = zodToSchema(SettingsSchema);\nexport const mapping = zodToSchema(MappingSchema);\n","import { z } from '@walkeros/core/dev';\n\nexport const SettingsSchema = z.object({\n siteId: z\n .number()\n .int()\n .positive()\n .describe(\n 'Your Hotjar site ID (e.g. 1234567). Find it in your Hotjar dashboard under Settings.',\n ),\n hotjarVersion: z\n .number()\n .int()\n .positive()\n .describe(\n 'Hotjar snippet version. Defaults to 6 (current). Override only if Hotjar releases a new version.',\n )\n .optional(),\n debug: z\n .boolean()\n .describe('Enable Hotjar debug mode for development troubleshooting.')\n .optional(),\n nonce: z\n .string()\n .describe(\n 'CSP nonce for the injected Hotjar script tag. Required when using strict Content-Security-Policy.',\n )\n .optional(),\n identify: z\n .unknown()\n .describe(\n 'walkerOS mapping value resolving to { userId, ...attributes } for Hotjar.identify(). userId is extracted as the first argument; remaining keys become user attributes.',\n )\n .optional(),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\nexport const MappingSchema = z.object({\n identify: z\n .unknown()\n .describe(\n 'Per-event identity mapping. Resolves to { userId, ...attributes } -> Hotjar.identify(userId, attributes).',\n )\n .optional(),\n stateChange: z\n .unknown()\n .describe(\n 'SPA route change notification. Resolves to a relative path string -> Hotjar.stateChange(path). Used for accurate heatmaps on virtual page views.',\n )\n .optional(),\n});\n\nexport type Mapping = z.infer<typeof MappingSchema>;\n","export * as env from './env';\nexport * as step from './step';\n","import type { Env } from '../types';\n\n/**\n * Example environment configurations for Hotjar destination.\n *\n * Tests clone `push` and replace individual methods with jest spies.\n * Production leaves `env.hotjar` undefined -- the destination falls back\n * to the real `@hotjar/browser` default export.\n */\n\nconst noop = (() => true) as (...args: unknown[]) => boolean;\n\n/**\n * Pre-init environment -- Hotjar SDK methods are no-ops until init wires them.\n */\nexport const init: Env | undefined = {\n hotjar: {\n init: noop as HotjarInit,\n event: noop,\n identify: noop as HotjarIdentify,\n stateChange: noop,\n isReady: () => false,\n },\n};\n\n/**\n * Post-init environment -- Hotjar SDK methods are spy-able no-ops.\n * Tests clone this and replace individual methods with jest.fn() for assertions.\n */\nexport const push: Env = {\n hotjar: {\n init: noop as HotjarInit,\n event: noop,\n identify: noop as HotjarIdentify,\n stateChange: noop,\n isReady: () => true,\n },\n};\n\n/**\n * Simulation tracking paths for CLI --simulate\n */\nexport const simulation = [\n 'call:hotjar.init',\n 'call:hotjar.event',\n 'call:hotjar.identify',\n 'call:hotjar.stateChange',\n];\n\n// Local helper types to narrow the generic `noop` to the specific SDK\n// signatures without loose casts.\ntype HotjarInit = NonNullable<Env['hotjar']>['init'];\ntype HotjarIdentify = NonNullable<Env['hotjar']>['identify'];\n","import type { Flow } from '@walkeros/core';\nimport { getEvent } from '@walkeros/core';\nimport type { Settings } from '../types';\n\n/**\n * Extended step example allowing destination-level settings overrides.\n */\nexport type HotjarStepExample = Flow.StepExample & {\n settings?: Partial<Settings>;\n};\n\n/**\n * Default event forwarding -- every walkerOS event becomes Hotjar.event(name).\n * No mapping rule; the destination's default push behavior fires.\n */\nexport const defaultEventForwarding: HotjarStepExample = {\n title: 'Default event',\n description:\n 'A walker event becomes a Hotjar.event call with the event name as the custom Hotjar event.',\n in: getEvent('product view', { timestamp: 1700000100 }),\n out: [['hotjar.event', 'product view']],\n};\n\n/**\n * Wildcard ignore pattern -- suppresses noisy events.\n * The destination must produce zero calls.\n */\nexport const wildcardIgnored: HotjarStepExample = {\n public: false,\n in: getEvent('debug noise', { timestamp: 1700000101 }),\n mapping: { ignore: true },\n out: [],\n};\n\n/**\n * Renamed event via mapping.name -- order complete becomes completed_purchase.\n */\nexport const renamedEvent: HotjarStepExample = {\n title: 'Renamed event',\n description:\n 'A mapping renames the event so the Hotjar custom event uses a canonical name like completed_purchase.',\n in: getEvent('order complete', { timestamp: 1700000102 }),\n mapping: {\n name: 'completed_purchase',\n },\n out: [['hotjar.event', 'completed_purchase']],\n};\n\n/**\n * Per-event identity via mapping.settings.identify.\n * Resolves { userId, ...attributes } -> Hotjar.identify(userId, attributes).\n * Identify fires before event per Hotjar's guidance.\n */\nexport const userLoginIdentify: HotjarStepExample = {\n title: 'User login identify',\n description:\n 'A user login fires Hotjar.identify with userId and attributes before firing the event.',\n in: getEvent('user login', {\n timestamp: 1700000103,\n data: { id: 'u-123', email: 'jane@example.com', plan: 'premium' },\n }),\n mapping: {\n settings: {\n identify: {\n map: {\n userId: 'data.id',\n email: 'data.email',\n plan: 'data.plan',\n },\n },\n },\n },\n out: [\n [\n 'hotjar.identify',\n 'u-123',\n { email: 'jane@example.com', plan: 'premium' },\n ],\n ['hotjar.event', 'user login'],\n ],\n};\n\n/**\n * Destination-level settings.identify -- fires on every push.\n * Hotjar recommends calling identify() on every page load.\n */\nexport const destinationLevelIdentify: HotjarStepExample = {\n title: 'Destination identify',\n description:\n 'Destination-level identify calls Hotjar.identify with the user id on every push as Hotjar recommends.',\n in: getEvent('page view', { timestamp: 1700000104 }),\n settings: {\n identify: {\n map: {\n userId: 'user.id',\n },\n },\n },\n out: [\n ['hotjar.identify', 'us3r', {}],\n ['hotjar.event', 'page view'],\n ],\n};\n\n/**\n * SPA state change -- stateChange mapping resolves to path string.\n * silent=true suppresses the default Hotjar.event() call.\n */\nexport const pageViewStateChange: HotjarStepExample = {\n title: 'State change',\n description:\n 'An SPA navigation fires Hotjar.stateChange with the new path instead of a Hotjar custom event.',\n in: getEvent('page view', { timestamp: 1700000105 }),\n mapping: {\n silent: true,\n settings: {\n stateChange: 'data.id',\n },\n },\n out: [['hotjar.stateChange', '/docs/']],\n};\n\n/**\n * Combined features -- identify + renamed event on the same push.\n * Execution order: identify -> event.\n */\nexport const combinedFeatures: HotjarStepExample = {\n title: 'Combined features',\n description:\n 'A purchase fires Hotjar.identify then the renamed custom event in the canonical execution order.',\n in: getEvent('order complete', { timestamp: 1700000106 }),\n mapping: {\n name: 'completed_purchase',\n settings: {\n identify: { map: { userId: 'user.id' } },\n },\n },\n out: [\n ['hotjar.identify', 'us3r', {}],\n ['hotjar.event', 'completed_purchase'],\n ],\n};\n\n/**\n * mapping.silent -- suppresses the default Hotjar.event() call. No other\n * settings active, so the destination produces zero calls.\n */\nexport const pageViewSilent: HotjarStepExample = {\n public: false,\n in: getEvent('page view', { timestamp: 1700000107 }),\n mapping: {\n silent: true,\n },\n out: [],\n};\n"],"mappings":";;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAAS,mBAAmB;;;ACA5B,SAAS,SAAS;AAEX,IAAM,iBAAiB,EAAE,OAAO;AAAA,EACrC,QAAQ,EACL,OAAO,EACP,IAAI,EACJ,SAAS,EACT;AAAA,IACC;AAAA,EACF;AAAA,EACF,eAAe,EACZ,OAAO,EACP,IAAI,EACJ,SAAS,EACT;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,OAAO,EACJ,QAAQ,EACR,SAAS,2DAA2D,EACpE,SAAS;AAAA,EACZ,OAAO,EACJ,OAAO,EACP;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,UAAU,EACP,QAAQ,EACR;AAAA,IACC;AAAA,EACF,EACC,SAAS;AACd,CAAC;;;AClCD,SAAS,KAAAA,UAAS;AAEX,IAAM,gBAAgBA,GAAE,OAAO;AAAA,EACpC,UAAUA,GACP,QAAQ,EACR;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,aAAaA,GACV,QAAQ,EACR;AAAA,IACC;AAAA,EACF,EACC,SAAS;AACd,CAAC;;;AFPM,IAAM,WAAW,YAAY,cAAc;AAC3C,IAAM,UAAU,YAAY,aAAa;;;AGThD;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUA,IAAM,QAAQ,MAAM;AAKb,IAAM,OAAwB;AAAA,EACnC,QAAQ;AAAA,IACN,MAAM;AAAA,IACN,OAAO;AAAA,IACP,UAAU;AAAA,IACV,aAAa;AAAA,IACb,SAAS,MAAM;AAAA,EAC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":3,"sources":["../src/schemas/index.ts","../src/schemas/settings.ts","../src/schemas/mapping.ts","../src/examples/index.ts","../src/examples/env.ts","../src/examples/step.ts"],"sourcesContent":["import { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema } from './settings';\nimport { MappingSchema } from './mapping';\n\nexport { SettingsSchema, type Settings } from './settings';\nexport { MappingSchema, type Mapping } from './mapping';\n\n// JSON Schema\nexport const settings = zodToSchema(SettingsSchema);\nexport const mapping = zodToSchema(MappingSchema);\n","import { z } from '@walkeros/core/dev';\n\nexport const SettingsSchema = z.object({\n siteId: z\n .number()\n .int()\n .positive()\n .describe(\n 'Your Hotjar site ID (e.g. 1234567). Find it in your Hotjar dashboard under Settings.',\n ),\n hotjarVersion: z\n .number()\n .int()\n .positive()\n .describe(\n 'Hotjar snippet version. Defaults to 6 (current). Override only if Hotjar releases a new version.',\n )\n .optional(),\n debug: z\n .boolean()\n .describe('Enable Hotjar debug mode for development troubleshooting.')\n .optional(),\n nonce: z\n .string()\n .describe(\n 'CSP nonce for the injected Hotjar script tag. Required when using strict Content-Security-Policy.',\n )\n .optional(),\n identify: z\n .unknown()\n .describe(\n 'walkerOS mapping value resolving to { userId, ...attributes } for Hotjar.identify(). userId is extracted as the first argument; remaining keys become user attributes.',\n )\n .optional(),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\nexport const MappingSchema = z.object({\n identify: z\n .unknown()\n .describe(\n 'Per-event identity mapping. Resolves to { userId, ...attributes } -> Hotjar.identify(userId, attributes).',\n )\n .optional(),\n stateChange: z\n .unknown()\n .describe(\n 'SPA route change notification. Resolves to a relative path string -> Hotjar.stateChange(path). Used for accurate heatmaps on virtual page views.',\n )\n .optional(),\n});\n\nexport type Mapping = z.infer<typeof MappingSchema>;\n","export * as env from './env';\nexport * as step from './step';\n","import type { Env } from '../types';\n\n/**\n * Example environment configurations for Hotjar destination.\n *\n * Tests clone `push` and replace individual methods with jest spies.\n * Production leaves `env.hotjar` undefined -- the destination falls back\n * to the real `@hotjar/browser` default export.\n */\n\nconst noop = (() => true) as (...args: unknown[]) => boolean;\n\n/**\n * Pre-init environment -- Hotjar SDK methods are no-ops until init wires them.\n */\nexport const init: Env | undefined = {\n hotjar: {\n init: noop as HotjarInit,\n event: noop,\n identify: noop as HotjarIdentify,\n stateChange: noop,\n isReady: () => false,\n },\n};\n\n/**\n * Post-init environment -- Hotjar SDK methods are spy-able no-ops.\n * Tests clone this and replace individual methods with jest.fn() for assertions.\n */\nexport const push: Env = {\n hotjar: {\n init: noop as HotjarInit,\n event: noop,\n identify: noop as HotjarIdentify,\n stateChange: noop,\n isReady: () => true,\n },\n};\n\n/**\n * Simulation tracking paths for CLI --simulate\n */\nexport const simulation = [\n 'call:hotjar.init',\n 'call:hotjar.event',\n 'call:hotjar.identify',\n 'call:hotjar.stateChange',\n];\n\n// Local helper types to narrow the generic `noop` to the specific SDK\n// signatures without loose casts.\ntype HotjarInit = NonNullable<Env['hotjar']>['init'];\ntype HotjarIdentify = NonNullable<Env['hotjar']>['identify'];\n","import type { Flow } from '@walkeros/core';\nimport { getEvent } from '@walkeros/core';\nimport type { Settings } from '../types';\n\n/**\n * Extended step example allowing destination-level settings overrides.\n */\nexport type HotjarStepExample = Flow.StepExample & {\n settings?: Partial<Settings>;\n};\n\n/**\n * Default event forwarding -- every walkerOS event becomes Hotjar.event(name).\n * No mapping rule; the destination's default push behavior fires.\n */\nexport const defaultEventForwarding: HotjarStepExample = {\n title: 'Default event',\n description:\n 'A walker event becomes a Hotjar.event call with the event name as the custom Hotjar event.',\n in: getEvent('product view', { timestamp: 1700000100 }),\n out: [['hotjar.event', 'product view']],\n};\n\n/**\n * Wildcard ignore pattern -- suppresses noisy events.\n * The destination must produce zero calls.\n */\nexport const wildcardIgnored: HotjarStepExample = {\n public: false,\n in: getEvent('debug noise', { timestamp: 1700000101 }),\n mapping: { ignore: true },\n out: [],\n};\n\n/**\n * Renamed event via mapping.name -- order complete becomes completed_purchase.\n */\nexport const renamedEvent: HotjarStepExample = {\n title: 'Renamed event',\n description:\n 'A mapping renames the event so the Hotjar custom event uses a canonical name like completed_purchase.',\n in: getEvent('order complete', { timestamp: 1700000102 }),\n mapping: {\n name: 'completed_purchase',\n },\n out: [['hotjar.event', 'completed_purchase']],\n};\n\n/**\n * Per-event identity via mapping.settings.identify.\n * Resolves { userId, ...attributes } -> Hotjar.identify(userId, attributes).\n * Identify fires before event per Hotjar's guidance.\n */\nexport const userLoginIdentify: HotjarStepExample = {\n title: 'User login identify',\n description:\n 'A user login fires Hotjar.identify with userId and attributes before firing the event.',\n in: getEvent('user login', {\n timestamp: 1700000103,\n data: { id: 'u-123', email: 'jane@example.com', plan: 'premium' },\n }),\n mapping: {\n settings: {\n identify: {\n map: {\n userId: 'data.id',\n email: 'data.email',\n plan: 'data.plan',\n },\n },\n },\n },\n out: [\n [\n 'hotjar.identify',\n 'u-123',\n { email: 'jane@example.com', plan: 'premium' },\n ],\n ['hotjar.event', 'user login'],\n ],\n};\n\n/**\n * Destination-level settings.identify -- fires on every push.\n * Hotjar recommends calling identify() on every page load.\n */\nexport const destinationLevelIdentify: HotjarStepExample = {\n title: 'Destination identify',\n description:\n \"With settings.identify mapping userId to 'user.id', the destination calls Hotjar.identify on every push, as Hotjar recommends, before the event.\",\n in: getEvent('page view', { timestamp: 1700000104 }),\n settings: {\n identify: {\n map: {\n userId: 'user.id',\n },\n },\n },\n out: [\n ['hotjar.identify', 'us3r', {}],\n ['hotjar.event', 'page view'],\n ],\n};\n\n/**\n * SPA state change -- stateChange mapping resolves to path string.\n * silent=true suppresses the default Hotjar.event() call.\n */\nexport const pageViewStateChange: HotjarStepExample = {\n title: 'State change',\n description:\n 'An SPA navigation fires Hotjar.stateChange with the new path instead of a Hotjar custom event.',\n in: getEvent('page view', { timestamp: 1700000105 }),\n mapping: {\n silent: true,\n settings: {\n stateChange: 'data.id',\n },\n },\n out: [['hotjar.stateChange', '/docs/']],\n};\n\n/**\n * Combined features -- identify + renamed event on the same push.\n * Execution order: identify -> event.\n */\nexport const combinedFeatures: HotjarStepExample = {\n title: 'Combined features',\n description:\n 'A purchase fires Hotjar.identify then the renamed custom event in the canonical execution order.',\n in: getEvent('order complete', { timestamp: 1700000106 }),\n mapping: {\n name: 'completed_purchase',\n settings: {\n identify: { map: { userId: 'user.id' } },\n },\n },\n out: [\n ['hotjar.identify', 'us3r', {}],\n ['hotjar.event', 'completed_purchase'],\n ],\n};\n\n/**\n * mapping.silent -- suppresses the default Hotjar.event() call. No other\n * settings active, so the destination produces zero calls.\n */\nexport const pageViewSilent: HotjarStepExample = {\n public: false,\n in: getEvent('page view', { timestamp: 1700000107 }),\n mapping: {\n silent: true,\n },\n out: [],\n};\n"],"mappings":";;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAAS,mBAAmB;;;ACA5B,SAAS,SAAS;AAEX,IAAM,iBAAiB,EAAE,OAAO;AAAA,EACrC,QAAQ,EACL,OAAO,EACP,IAAI,EACJ,SAAS,EACT;AAAA,IACC;AAAA,EACF;AAAA,EACF,eAAe,EACZ,OAAO,EACP,IAAI,EACJ,SAAS,EACT;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,OAAO,EACJ,QAAQ,EACR,SAAS,2DAA2D,EACpE,SAAS;AAAA,EACZ,OAAO,EACJ,OAAO,EACP;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,UAAU,EACP,QAAQ,EACR;AAAA,IACC;AAAA,EACF,EACC,SAAS;AACd,CAAC;;;AClCD,SAAS,KAAAA,UAAS;AAEX,IAAM,gBAAgBA,GAAE,OAAO;AAAA,EACpC,UAAUA,GACP,QAAQ,EACR;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,aAAaA,GACV,QAAQ,EACR;AAAA,IACC;AAAA,EACF,EACC,SAAS;AACd,CAAC;;;AFPM,IAAM,WAAW,YAAY,cAAc;AAC3C,IAAM,UAAU,YAAY,aAAa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IAC9B,CAAC,gBAAgB,oBAAoB;AAAA,EACvC;AACF;AAMO,IAAM,iBAAoC;AAAA,EAC/C,QAAQ;AAAA,EACR,IAAI,SAAS,aAAa,EAAE,WAAW,WAAW,CAAC;AAAA,EACnD,SAAS;AAAA,IACP,QAAQ;AAAA,EACV;AAAA,EACA,KAAK,CAAC;AACR;","names":["z"]}
@@ -121,7 +121,7 @@ var userLoginIdentify = {
121
121
  };
122
122
  var destinationLevelIdentify = {
123
123
  title: "Destination identify",
124
- description: "Destination-level identify calls Hotjar.identify with the user id on every push as Hotjar recommends.",
124
+ description: "With settings.identify mapping userId to 'user.id', the destination calls Hotjar.identify on every push, as Hotjar recommends, before the event.",
125
125
  in: (0, import_core.getEvent)("page view", { timestamp: 1700000104 }),
126
126
  settings: {
127
127
  identify: {
@@ -100,7 +100,7 @@ var userLoginIdentify = {
100
100
  };
101
101
  var destinationLevelIdentify = {
102
102
  title: "Destination identify",
103
- description: "Destination-level identify calls Hotjar.identify with the user id on every push as Hotjar recommends.",
103
+ description: "With settings.identify mapping userId to 'user.id', the destination calls Hotjar.identify on every push, as Hotjar recommends, before the event.",
104
104
  in: getEvent("page view", { timestamp: 1700000104 }),
105
105
  settings: {
106
106
  identify: {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$meta": {
3
3
  "package": "@walkeros/web-destination-hotjar",
4
- "version": "4.7.2",
4
+ "version": "4.8.0-next-1791441510508",
5
5
  "type": "destination",
6
6
  "platform": [
7
7
  "web"
@@ -186,7 +186,7 @@
186
186
  "consent": {
187
187
  "functional": true
188
188
  },
189
- "id": "67b644d7fe22f5f7",
189
+ "id": "d95f67d01104d692",
190
190
  "trigger": "load",
191
191
  "entity": "order",
192
192
  "action": "complete",
@@ -254,7 +254,7 @@
254
254
  "consent": {
255
255
  "functional": true
256
256
  },
257
- "id": "fc030fc11ab8c034",
257
+ "id": "2b649799df858a0f",
258
258
  "trigger": "load",
259
259
  "entity": "product",
260
260
  "action": "view",
@@ -276,7 +276,7 @@
276
276
  },
277
277
  "destinationLevelIdentify": {
278
278
  "title": "Destination identify",
279
- "description": "Destination-level identify calls Hotjar.identify with the user id on every push as Hotjar recommends.",
279
+ "description": "With settings.identify mapping userId to 'user.id', the destination calls Hotjar.identify on every push, as Hotjar recommends, before the event.",
280
280
  "in": {
281
281
  "name": "page view",
282
282
  "data": {
@@ -315,7 +315,7 @@
315
315
  "consent": {
316
316
  "functional": true
317
317
  },
318
- "id": "82ec44b5c52ff70f",
318
+ "id": "3871329c88337eb4",
319
319
  "trigger": "load",
320
320
  "entity": "page",
321
321
  "action": "view",
@@ -387,7 +387,7 @@
387
387
  "consent": {
388
388
  "functional": true
389
389
  },
390
- "id": "4ca0d7b6ba305752",
390
+ "id": "c6566f68b220b001",
391
391
  "trigger": "load",
392
392
  "entity": "page",
393
393
  "action": "view",
@@ -446,7 +446,7 @@
446
446
  "consent": {
447
447
  "functional": true
448
448
  },
449
- "id": "14671c8dcda1fb73",
449
+ "id": "a6070e2e675cae15",
450
450
  "trigger": "load",
451
451
  "entity": "page",
452
452
  "action": "view",
@@ -552,7 +552,7 @@
552
552
  "consent": {
553
553
  "functional": true
554
554
  },
555
- "id": "c0da6caf9db7c41f",
555
+ "id": "517d5e1d13189c7f",
556
556
  "trigger": "load",
557
557
  "entity": "order",
558
558
  "action": "complete",
@@ -613,7 +613,7 @@
613
613
  "consent": {
614
614
  "functional": true
615
615
  },
616
- "id": "e4996656e1fd3307",
616
+ "id": "5700ded80dee450b",
617
617
  "trigger": "test",
618
618
  "entity": "user",
619
619
  "action": "login",
@@ -694,7 +694,7 @@
694
694
  "consent": {
695
695
  "functional": true
696
696
  },
697
- "id": "bb9a52c5627b19fc",
697
+ "id": "55ff8a8e702bfe27",
698
698
  "trigger": "test",
699
699
  "entity": "debug",
700
700
  "action": "noise",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@walkeros/web-destination-hotjar",
3
3
  "description": "Hotjar web destination for walkerOS (session replay, heatmaps, surveys)",
4
- "version": "4.7.2",
4
+ "version": "4.8.0-next-1791441510508",
5
5
  "license": "MIT",
6
6
  "main": "./dist/index.js",
7
7
  "module": "./dist/index.mjs",
@@ -39,11 +39,11 @@
39
39
  },
40
40
  "dependencies": {
41
41
  "@hotjar/browser": "^1.0.9",
42
- "@walkeros/core": "4.7.2",
43
- "@walkeros/web-core": "4.7.2"
42
+ "@walkeros/core": "4.8.0-next-1791441510508",
43
+ "@walkeros/web-core": "4.8.0-next-1791441510508"
44
44
  },
45
45
  "devDependencies": {
46
- "@walkeros/collector": "4.7.2"
46
+ "@walkeros/collector": "4.8.0-next-1791441510508"
47
47
  },
48
48
  "repository": {
49
49
  "url": "git+https://github.com/elbwalker/walkerOS.git",