{"_id":"@brightmotion/agenthog-capacitor","_rev":"4-663f3a17d963eeb6a3d1ca23f3f8f00d","name":"@brightmotion/agenthog-capacitor","dist-tags":{"latest":"0.4.0"},"versions":{"0.1.0":{"name":"@brightmotion/agenthog-capacitor","version":"0.1.0","keywords":["analytics","capacitor","ionic","agenthog","product-analytics","autocapture"],"license":"MIT","_id":"@brightmotion/agenthog-capacitor@0.1.0","maintainers":[{"name":"ericbrightmotion","email":"eric@brightmotion.io"},{"name":"cjuillard-brightmotion","email":"colin@brightmotion.io"}],"homepage":"https://hog.brightmotion.io","dist":{"shasum":"7c2fb089039e82027d0906456ab7b51d6177f6ae","tarball":"https://registry.npmjs.org/@brightmotion/agenthog-capacitor/-/agenthog-capacitor-0.1.0.tgz","fileCount":8,"integrity":"sha512-nVUHiPKWFTbTkTpqrPJElmo00Y3UP+2zdz3ykTBZKOy61ug/hfRNBass9LtEXxBobzxFDD4gFQsbN+Yh6GHzMA==","signatures":[{"sig":"MEYCIQC7x8zyUWEvbtB2eR+o3c6ZCF/2Vqu5d4G1i/0Gl1C5DgIhANxTcqJujqLq+78sSSeqZTxKLvRBoIm7gqhgZC9OLabw","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":237033},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./package.json":"./package.json"},"gitHead":"33dac939a5dcb4157abb6d7e71c7346e1fae7c40","scripts":{"test":"bun test","build":"tsup","prepack":"bun run build","typecheck":"tsc --noEmit","assert-dist":"bun scripts/assert-dist.ts","prepublishOnly":"bun run build && bun run assert-core-pure && bun run assert-dist && bun test","assert-core-pure":"bun scripts/assert-core-pure.ts"},"_npmUser":{"name":"ericbrightmotion","email":"eric@brightmotion.io"},"_npmVersion":"10.9.2","description":"AgentHog analytics for Capacitor hybrid apps — sessions, screen views, DOM autocapture, offline queue, identity, install attribution. Speaks CONTRACTS.md directly.","directories":{},"sideEffects":false,"_nodeVersion":"22.16.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","happy-dom":"^15.11.7","typescript":"^5.6.0","@capacitor/app":"^7.0.0","@capacitor/core":"^7.0.0","@capacitor/device":"^7.0.0","@capacitor/preferences":"^7.0.0"},"peerDependencies":{"@capacitor/app":">=5.0.0","@capacitor/core":">=5.0.0","@capacitor/device":">=5.0.0","@capacitor/preferences":">=5.0.0"},"_npmOperationalInternal":{"tmp":"tmp/agenthog-capacitor_0.1.0_1786650738900_0.39235742568287413","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@brightmotion/agenthog-capacitor","version":"0.2.0","keywords":["analytics","capacitor","ionic","agenthog","product-analytics","autocapture"],"license":"MIT","_id":"@brightmotion/agenthog-capacitor@0.2.0","maintainers":[{"name":"ericbrightmotion","email":"eric@brightmotion.io"},{"name":"cjuillard-brightmotion","email":"colin@brightmotion.io"}],"homepage":"https://hog.brightmotion.io","dist":{"shasum":"c9e85a1e50e7cf8eb47f5b68f58f9b9d7ae1f5dc","tarball":"https://registry.npmjs.org/@brightmotion/agenthog-capacitor/-/agenthog-capacitor-0.2.0.tgz","fileCount":8,"integrity":"sha512-hN2pQ5Cw/WbJwF7qLptEImZaU8AshovZo2G2535wRVfLEA0Y1i3qjr2M+5fIbL/uwOBFb+uelOjw6DWKRI/zgQ==","signatures":[{"sig":"MEUCIHyYKzwDSFto6kN+8tdaMHqdHcGjI29zt1rysy3OxtugAiEA8+T3goAQcK25ruNTKy+V2KVduTcVeaaZ6E+7IcHr8Y8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":278079},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./package.json":"./package.json"},"gitHead":"af03c7b10d4251ccc37eb9c15555088ef6c7d317","scripts":{"test":"bun test","build":"tsup","prepack":"bun run build","typecheck":"tsc --noEmit","assert-dist":"bun scripts/assert-dist.ts","prepublishOnly":"bun run build && bun run assert-core-pure && bun run assert-dist && bun test","assert-core-pure":"bun scripts/assert-core-pure.ts"},"_npmUser":{"name":"ericbrightmotion","email":"eric@brightmotion.io"},"_npmVersion":"10.9.2","description":"AgentHog analytics for Capacitor hybrid apps — sessions, screen views, DOM autocapture, offline queue, identity, install attribution. Speaks CONTRACTS.md directly.","directories":{},"sideEffects":false,"_nodeVersion":"22.16.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","happy-dom":"^15.11.7","typescript":"^5.6.0","@capacitor/app":"^7.0.0","@capacitor/core":"^7.0.0","@capacitor/device":"^7.0.0","@capacitor/preferences":"^7.0.0"},"peerDependencies":{"@capacitor/app":">=5.0.0","@capacitor/core":">=5.0.0","@capacitor/device":">=5.0.0","@capacitor/preferences":">=5.0.0"},"_npmOperationalInternal":{"tmp":"tmp/agenthog-capacitor_0.2.0_1786992003923_0.42987251072873023","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@brightmotion/agenthog-capacitor","version":"0.3.0","keywords":["analytics","capacitor","ionic","agenthog","product-analytics","autocapture"],"license":"MIT","_id":"@brightmotion/agenthog-capacitor@0.3.0","maintainers":[{"name":"ericbrightmotion","email":"eric@brightmotion.io"},{"name":"cjuillard-brightmotion","email":"colin@brightmotion.io"}],"homepage":"https://hog.brightmotion.io","dist":{"shasum":"8dcf7c8242b1842dbd7750ed563698afbe75868a","tarball":"https://registry.npmjs.org/@brightmotion/agenthog-capacitor/-/agenthog-capacitor-0.3.0.tgz","fileCount":9,"integrity":"sha512-SqBj6S/w7hUeey2NWrp7nyH5UsDXO1wRBuHTPL22WZ18Ead2HSPE+/b6OffM5wVa3nhWzblAKzoo/3BXWjk2vw==","signatures":[{"sig":"MEYCIQCiVu9+TxkzZw9Q2HYjVANx/dRYOKh699aTYsYSjoDdzQIhAJNOmbmL4S14EiSBHiKv0gpjwldhApvuAqAcvHe6bokr","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":323990},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./package.json":"./package.json"},"gitHead":"2ab75b84f562f9ecab64a335f1761eb138ae1f2a","scripts":{"test":"bun test","build":"tsup","prepack":"bun run build","typecheck":"tsc --noEmit","assert-dist":"bun scripts/assert-dist.ts","prepublishOnly":"bun run build && bun run assert-core-pure && bun run assert-dist && bun test","assert-core-pure":"bun scripts/assert-core-pure.ts"},"_npmUser":{"name":"ericbrightmotion","email":"eric@brightmotion.io"},"_npmVersion":"10.9.2","description":"AgentHog analytics for Capacitor hybrid apps — sessions, screen views, DOM autocapture, offline queue, identity, install attribution. Speaks CONTRACTS.md directly.","directories":{},"sideEffects":false,"_nodeVersion":"22.16.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","happy-dom":"^15.11.7","typescript":"^5.6.0","@capacitor/app":"^7.0.0","@capacitor/core":"^7.0.0","@capacitor/device":"^7.0.0","@capacitor/preferences":"^7.0.0"},"peerDependencies":{"@capacitor/app":">=5.0.0","@capacitor/core":">=5.0.0","@capacitor/device":">=5.0.0","@capacitor/preferences":">=5.0.0"},"_npmOperationalInternal":{"tmp":"tmp/agenthog-capacitor_0.3.0_1787322865775_0.8237823745193258","host":"s3://npm-registry-packages-npm-production"}},"0.4.0":{"name":"@brightmotion/agenthog-capacitor","version":"0.4.0","description":"AgentHog analytics for Capacitor hybrid apps — sessions, screen views, DOM autocapture, offline queue, identity, install attribution. Speaks CONTRACTS.md directly.","keywords":["analytics","capacitor","ionic","agenthog","product-analytics","autocapture"],"homepage":"https://hog.brightmotion.io","license":"MIT","type":"module","main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./package.json":"./package.json"},"sideEffects":false,"publishConfig":{"access":"public"},"scripts":{"test":"bun test","typecheck":"tsc --noEmit","build":"tsup","assert-core-pure":"bun scripts/assert-core-pure.ts","assert-dist":"bun scripts/assert-dist.ts","prepack":"bun run build","prepublishOnly":"bun run build && bun run assert-core-pure && bun run assert-dist && bun test"},"peerDependencies":{"@capacitor/app":">=5.0.0","@capacitor/core":">=5.0.0","@capacitor/device":">=5.0.0","@capacitor/preferences":">=5.0.0"},"devDependencies":{"@capacitor/app":"^7.0.0","@capacitor/core":"^7.0.0","@capacitor/device":"^7.0.0","@capacitor/preferences":"^7.0.0","happy-dom":"^15.11.7","tsup":"^8.3.5","typescript":"^5.6.0"},"_id":"@brightmotion/agenthog-capacitor@0.4.0","gitHead":"f2086318372b0acd284a5d27bc3ec5da5422c2b0","_nodeVersion":"22.21.1","_npmVersion":"10.9.4","dist":{"integrity":"sha512-LXaIkbwL3imX2E24k22fh0vEGIJKhKPX1zgCVrQ7yw9Wb+8L32LPNixTXqdqsnqbgC+8XEYwnuW5cVMNWbr+Qw==","shasum":"c36c9b4488fac9a772743ba1448524755b678745","tarball":"https://registry.npmjs.org/@brightmotion/agenthog-capacitor/-/agenthog-capacitor-0.4.0.tgz","fileCount":9,"unpackedSize":353140,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIEyvooL8mV+5ghLw8s+4hOXITxVSOKPYbr8Hj8Ia1arEAiA22pRi7uVuVEn/Lkhq7aGlyfPWRyXeB1df5PS1Ulmcxw=="}]},"_npmUser":{"name":"cjuillard-brightmotion","email":"colin@brightmotion.io"},"directories":{},"maintainers":[{"name":"ericbrightmotion","email":"eric@brightmotion.io"},{"name":"cjuillard-brightmotion","email":"colin@brightmotion.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/agenthog-capacitor_0.4.0_1787766601003_0.35144859442320264"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-13T19:52:18.698Z","modified":"2026-08-26T17:50:01.344Z","0.1.0":"2026-08-13T19:52:19.056Z","0.2.0":"2026-08-17T18:40:04.082Z","0.3.0":"2026-08-21T14:34:25.917Z","0.4.0":"2026-08-26T17:50:01.165Z"},"license":"MIT","homepage":"https://hog.brightmotion.io","keywords":["analytics","capacitor","ionic","agenthog","product-analytics","autocapture"],"description":"AgentHog analytics for Capacitor hybrid apps — sessions, screen views, DOM autocapture, offline queue, identity, install attribution. Speaks CONTRACTS.md directly.","maintainers":[{"name":"ericbrightmotion","email":"eric@brightmotion.io"},{"name":"cjuillard-brightmotion","email":"colin@brightmotion.io"}],"readme":"# @brightmotion/agenthog-capacitor\n\nAgentHog analytics for Capacitor hybrid apps: sessions, screen views, DOM autocapture\n(clicks, forms, inputs, scroll depth), custom events, identity, a persisted offline queue,\nand install attribution — from one `init()` call.\n\nRequires Capacitor ≥5 and the official `@capacitor/app`, `@capacitor/device`, and\n`@capacitor/preferences` plugins (no custom native code). Batches post through\n`CapacitorHttp`, so sessions classify as mobile app traffic and work with the ingest\ndomain allowlist out of the box.\n\n## Install\n\n```bash\nnpm i @brightmotion/agenthog-capacitor @capacitor/app @capacitor/device @capacitor/preferences\nnpx cap sync\n```\n\n## Setup\n\nCall `init` once at app bootstrap, before first render:\n\n```ts\nimport { AgentHog } from '@brightmotion/agenthog-capacitor'\n\nawait AgentHog.init({\n  host: 'https://hog.brightmotion.io',\n  projectKey: import.meta.env.VITE_AGENTHOG_KEY ?? '',\n  enabled: !!import.meta.env.VITE_AGENTHOG_KEY, // inert no-op without a key (dev builds)\n  appName: 'my-app',\n  appVersion: '1.0.0', // ideally from App.getInfo()\n})\n```\n\nCalls made before `init` resolves are buffered and replayed — nothing is dropped.\n\nWhat is automatic: screen views from your router (history and hash routing both;\n`trackScreens: false` + `AgentHog.screen('/path')` to drive manually), tap/click autocapture\nwith shadow-DOM-aware labels (Ionic components included), form submits, input focus\n(field names only, never values), scroll depth at 25/50/75/90/100%, per-screen time via\n`leave` events, 30-min-idle sessions across app background/foreground, and an offline\nqueue that survives restarts.\n\n## API\n\n```ts\nAgentHog.capture('run_logged', { miles: 3.1 })  // snake_case names, values in props\nAgentHog.identify(email, { user_id })            // at sign-in / after sign-up\nAgentHog.register({ team_size: 5 })              // merged into every later event\nAgentHog.tag('beta_cohort', true)\nAgentHog.reset()                                 // sign-out: new anonymous person\nAgentHog.setLandingParams({ utm_source: 'appstore' }) // before first flush\nAgentHog.onAttribution((a) => { /* install attribution result */ })\n// MMP attach (e.g. Singular's attribution callback) → the session's utm_* columns.\n// Delivered once per distinct payload; a deep link's own params still win.\nAgentHog.setAttribution({ provider: 'singular', utm_source: network, utm_campaign, params: { campaign_id } })\n```\n\n## Verify\n\nRun the app, tap through a few screens, then `ah events --since 1h` (or the dashboard).\nExpect `pageview:` rows within ~10 seconds. The session appears under the mobile lens\n(`browser = 'app'`), with `platform: ios|android` as an event prop.\n\nFull docs: https://hog.brightmotion.io/docs/integrate\n","readmeFilename":"README.md"}