{"_id":"@carter-rmn/umm-pixel-sdk","name":"@carter-rmn/umm-pixel-sdk","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@carter-rmn/umm-pixel-sdk","version":"0.1.0","description":"UMM browser Pixel SDK - sends events to umm-eis via the API gateway.","type":"module","main":"dist/carter.umd.cjs","module":"dist/carter.js","types":"dist/main.d.ts","exports":{".":{"types":"./dist/main.d.ts","import":"./dist/carter.js","require":"./dist/carter.umd.cjs"}},"keywords":["analytics","pixel","umm","carter"],"license":"ISC","publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"engines":{"node":">=18.16.1"},"devDependencies":{"@typescript-eslint/eslint-plugin":"^7.0.0","@typescript-eslint/parser":"^7.0.0","eslint":"^8.57.0","eslint-config-prettier":"^9.1.0","jsdom":"^24.0.0","prettier":"^3.2.5","typescript":"^5.4.0","vite":"^5.2.0","vite-plugin-dts":"^3.8.1","vitest":"^1.4.0"},"scripts":{"dev":"vite","typecheck":"tsc --noEmit","build":"tsc --noEmit && vite build && node scripts/copy-template.mjs","size":"node scripts/check-size.mjs","test":"vitest run","lint":"eslint . --ext .ts","format":"prettier --write ."},"_id":"@carter-rmn/umm-pixel-sdk@0.1.0","_integrity":"sha512-/D2P4fG0FHjIRqj8M2bEui/6hZwFkH34yDQw8Q6X7N6MsTzsri5fcsjJinFsrpVclgf30gbVmlWCDRGGX5jXOg==","_resolved":"/tmp/e8dcd5fec69d07cb05a4ce7a9a67b108/carter-rmn-umm-pixel-sdk-0.1.0.tgz","_from":"file:carter-rmn-umm-pixel-sdk-0.1.0.tgz","_nodeVersion":"20.20.2","_npmVersion":"10.8.2","dist":{"integrity":"sha512-/D2P4fG0FHjIRqj8M2bEui/6hZwFkH34yDQw8Q6X7N6MsTzsri5fcsjJinFsrpVclgf30gbVmlWCDRGGX5jXOg==","shasum":"934f6b2f5df3cdf60541491b6bdc0aa62122a94a","tarball":"https://registry.npmjs.org/@carter-rmn/umm-pixel-sdk/-/umm-pixel-sdk-0.1.0.tgz","fileCount":31,"unpackedSize":126077,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIFhoXuzFjyNKcsGBt3iM6r1pVJ08Nb2DlVMcZHDjOyQUAiEAu1kK/rV/7C+yRnbDW7m0IV+WWDMQtJze+792YSsbPYU="}]},"_npmUser":{"name":"ads-shyftlabs","email":"ads@shyftlabs.io"},"directories":{},"maintainers":[{"name":"ads-shyftlabs","email":"ads@shyftlabs.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/umm-pixel-sdk_0.1.0_1783677931177_0.9635091812531607"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-10T10:05:31.049Z","0.1.0":"2026-07-10T10:05:31.388Z","modified":"2026-07-10T10:05:31.584Z"},"maintainers":[{"name":"ads-shyftlabs","email":"ads@shyftlabs.io"}],"description":"UMM browser Pixel SDK - sends events to umm-eis via the API gateway.","keywords":["analytics","pixel","umm","carter"],"license":"ISC","readme":"# UMM-Pixel-SDK\n\nBrowser Pixel SDK for the Unified Measurement Model. Captures events in the\nbrowser and sends them to **umm-eis** through the API gateway (single endpoint).\n\nSee [`IMPLEMENTATION_PLAN.md`](./docs/IMPLEMENTATION_PLAN.md) for the full design.\n\n## Install on a site\n\n```html\n<script>\n  window.carter = window.carter || function(){(carter.q=carter.q||[]).push(arguments)};\n  carter('init', 'CRT-XXXX', { endpoint: 'https://m.brand.com' }); // CRT-XXXX = tenant_id (= pixel_id)\n</script>\n<script async src=\"https://cdn.example.com/carter.iife.js\"></script>\n```\n\n## API - `carter(command, …)`\n\n| Command | Usage |\n|---|---|\n| `init` | `carter('init', tenant_id, options)` - boot. `options.endpoint` is the single API gateway URL. |\n| `track` | `carter('track', 'purchase', { value: 89, currency: 'USD' })` |\n| `identify` | `carter('identify', { email, phone, customer_id })` - email/phone are SHA-256 hashed in-browser. |\n| `consent` | `carter('consent', 'granted' \\| 'pending' \\| 'denied')` - explicit override. |\n\n**Init options:** `endpoint` (required), `debug`, `session_expiry_days`,\n`common_properties`, `user_properties`, `auto_detect` (default true),\n`url_rules`, `consent_required` (default false).\n\n## What it does\n\n- **Identity:** `tenant_id` (= pixel id, sent on every event) · durable `anonymous_customer_id`\n  (1P cookie, for stitching) · per-session `session_id`.\n- **Auth:** none (Phase 1) - the `tenant_id` identifies the account. No token/KMS.\n- **Transport:** `sendBeacon` with `fetch keepalive` fallback → `POST {endpoint}/events`.\n- **Auto-detection:** `page_view` (history) + JSON-LD (Product/Order), GA4 `dataLayer`,\n  per-tenant URL rules, and `data-page-type`.\n- **Consent:** TCF v2.2 (`__tcfapi`) + GPC gate (granted → send, pending → hold, denied → drop).\n- **Privacy:** raw email/phone never leave the page (SHA-256 only).\n- **Bot filtering:** automated browsers are skipped.\n\n## Develop\n\n```bash\npnpm install\npnpm dev          # vite dev\npnpm typecheck\npnpm test         # vitest\npnpm build        # → dist/ (es, cjs, umd, iife). carter.iife.js is the CDN artifact.\npnpm size         # gzip budget gate (<50 KB)\n```\n\nExample stores: `pnpm build`, then `npx serve example` and open the landing\npage. Two integrations of the same demo shop - `example/manual/` (explicit\n`carter('track')` calls) and `example/auto/` (head snippet + auto-detect). Each\npage mirrors captured events in an on-page inspector, so they work without a\nrunning umm-eis. See [`example/README.md`](./example/README.md).\n\n## Schema sync\n\nThe event shape in [`src/schema/event.ts`](./src/schema/event.ts) is the canonical\ndefinition and must stay in sync with the `PixelEvent` struct in **umm-eis** (Go).\nThere is no shared schema package - keep both in step (PR checklist + CI contract test).\n","readmeFilename":"README.md","_rev":"1-2cdfa6d4cff4a32bf25e64bc75e3436c"}