{"_id":"11metrics-pixel-js","name":"11metrics-pixel-js","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"11metrics-pixel-js","version":"0.1.0","description":"Framework-agnostic loader for the 11metrics tracking pixel. Injects pixel.js, exposes typed init/pageview/track/identify helpers, and queues calls made before the script finishes loading. Use this directly in any bundler-based app, or via a framework adap","license":"MIT","author":{"name":"11metrics Ltd."},"homepage":"https://app.11metrics.ai/extensions","keywords":["11metrics","analytics","tracking","pixel","attribution"],"private":false,"type":"module","main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"sideEffects":false,"scripts":{"build":"tsc -p tsconfig.json","clean":"rm -rf dist","test":"node smoke-test.mjs"},"devDependencies":{"typescript":"^5.6.0","@types/node":"^22.0.0"},"gitHead":"07e2aa3f94bc6f673be14bfa0b5e7047d42a0496","_id":"11metrics-pixel-js@0.1.0","_nodeVersion":"25.2.1","_npmVersion":"11.6.2","dist":{"integrity":"sha512-8SB5NqiKdDjaqhuqcvJKFKZ8OkFxaDcLLhnKI6DBhXOt63u8FcscdXVqxL1zTv9Qg5hNxW18zwQD3kWwkjX4iw==","shasum":"d3d40a00bc5e00aafcc9b7a640bf7ae9189cab58","tarball":"https://registry.npmjs.org/11metrics-pixel-js/-/11metrics-pixel-js-0.1.0.tgz","fileCount":7,"unpackedSize":15160,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQC9873AgfQoSzEYKQy6cttw79gFuO/8JKjvXSG1ut6CGgIhAPzswlQ+VpdhgaGZ1P+K3vVOnsRgFu57683VIgXPecDX"}]},"_npmUser":{"name":"11metrics","email":"marco.stranieri@11metrics.ai"},"directories":{},"maintainers":[{"name":"11metrics","email":"marco.stranieri@11metrics.ai"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/11metrics-pixel-js_0.1.0_1783057965112_0.7652051723666291"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-03T05:52:45.036Z","0.1.0":"2026-07-03T05:52:45.257Z","modified":"2026-07-03T05:52:45.491Z"},"maintainers":[{"name":"11metrics","email":"marco.stranieri@11metrics.ai"}],"description":"Framework-agnostic loader for the 11metrics tracking pixel. Injects pixel.js, exposes typed init/pageview/track/identify helpers, and queues calls made before the script finishes loading. Use this directly in any bundler-based app, or via a framework adap","homepage":"https://app.11metrics.ai/extensions","keywords":["11metrics","analytics","tracking","pixel","attribution"],"author":{"name":"11metrics Ltd."},"license":"MIT","readme":"# 11metrics-pixel-js\n\nFramework-agnostic loader for the 11metrics tracking pixel. Use this directly\nin any bundler-based app (Vite, CRA, plain webpack, etc.), or via a framework\nadapter such as [`11metrics-pixel-next`](../pixel-next) for Next.js.\n\nThis package does not reimplement pixel tracking — it injects the real\n`pixel.js` script served by your 11metrics app and gives you a typed API on\ntop of `window._pulse`, queueing calls made before the script finishes\nloading.\n\n## Install\n\n```\nnpm install 11metrics-pixel-js\n```\n\n(Not yet published — see \"Publishing\" below.)\n\n## Usage\n\n```ts\nimport { init, pageview, track, identify } from '11metrics-pixel-js';\n\ninit({\n  pixelId: 'YOUR_PIXEL_ID', // Settings → Pixel Setup in the 11metrics app\n  pixelUrl: 'https://app.11metrics.ai', // optional, this is the default\n});\n\n// SPA route change (no full page load) — the initial script load already\n// covers the first pageview.\npageview();\n\n// Custom event.\ntrack('video_play', { video_id: 'abc123' });\n\n// After login / a gated form. email/phone are hashed client-side.\nidentify({ email: 'user@example.com', first_name: 'Marco' });\n```\n\n## API\n\n- `init(config: { pixelId: string; pixelUrl?: string })` — injects the pixel\n  script. Safe to call multiple times; only injects once. No-ops on the\n  server.\n- `pageview()` — manually fire a pageview. Call on every client-side route\n  change.\n- `track(name, meta?)` — custom event.\n- `identify(data)` — `{ email?, phone?, first_name?, last_name? }`.\n- `setNetworkConsent(value)` — cross-workspace identity opt-in/out.\n\n## Notes\n\n- Requires `PIXEL_URL`'s target app to be running a build with\n  `window._pulse.pageview()` exposed (added alongside this package — see\n  `public/pixel.js` / `pixel/pixel.js` in the main app repo).\n- Consent handling (the cookie banner, `_pulse_consent` gating on\n  `identify()`/form submits) lives entirely in `pixel.js` itself — this\n  wrapper does not duplicate or override it.\n\n## Local development\n\nThis package isn't published yet. To build/test it locally:\n\n```\nnpm install\nnpm run build\nnpm test\n```\n\nTo develop `11metrics-pixel-next` against your local changes here (before\npublishing), from `../pixel-next` run:\n\n```\nnpm install file:../pixel-js --no-save --legacy-peer-deps\n```\n\n`--no-save` keeps `package.json` pointed at the real `^0.1.0` registry range\n(what actually ships to consumers) rather than a filesystem path.\n\n## Publishing\n\n```\nnpm run build\nnpm test\nnpm login          # once, with your npm account\nnpm publish         # from this directory\n```\n\nBump `version` in `package.json` first if this isn't the first release.\n","readmeFilename":"README.md","_rev":"1-caff85abb322a6e056c901d5e05e6a27"}