{"_id":"@absolutejs/audience","_rev":"4-e8c40e219b8f62cacd1f91752130fa1e","name":"@absolutejs/audience","dist-tags":{"latest":"0.0.4"},"versions":{"0.0.1":{"name":"@absolutejs/audience","version":"0.0.1","author":"Alex Kahn","license":"BSL-1.1","_id":"@absolutejs/audience@0.0.1","maintainers":[{"name":"alexkahndev","email":"alexkahn2019@gmail.com"}],"dist":{"shasum":"e6b665c5d99072f28966d760d3b87c1f4425ad10","tarball":"https://registry.npmjs.org/@absolutejs/audience/-/audience-0.0.1.tgz","fileCount":8,"integrity":"sha512-6Yz1Qxf/euTFhuA8/ireY3Z+iMpgXshQj5Vrp1AORnnpGnE+6lT+J4QAeSuqogT73MOK96w1Hjo4z4ChOBDHsQ==","signatures":[{"sig":"MEUCIQD0zbnvCcm5FHcEbd0tQDKQcm7jAS3lBLL0N5FFoIeRMQIgT5neL8GDkZQbq5rHIEPZDMrx0I9U2HLz08GPR0IDDvE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":16745},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","shasum":"e6b665c5d99072f28966d760d3b87c1f4425ad10","scripts":{"test":"bun test","build":"rm -rf dist && bun build src/index.ts --outdir dist --target=bun --external zod && tsc --emitDeclarationOnly --project tsconfig.json","release":"bun run build && bun publish","typecheck":"tsc --noEmit"},"_npmUser":{"name":"alexkahndev","email":"alexkahn2019@gmail.com"},"_integrity":"sha512-6Yz1Qxf/euTFhuA8/ireY3Z+iMpgXshQj5Vrp1AORnnpGnE+6lT+J4QAeSuqogT73MOK96w1Hjo4z4ChOBDHsQ==","repository":{"url":"https://github.com/absolutejs/audience.git","type":"git"},"_npmVersion":"10.8.3","description":"In-house audience & affinity intelligence — psychographic inference, interest/brand affinity profiles, and audience-overlap scoring from public signals, provider- and embedding-injected, so you don't pay an audience-intelligence SaaS per seat.","directories":{},"_nodeVersion":"24.3.0","dependencies":{"zod":"^4.3.6"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"latest","typescript":"5.9.3"},"_npmOperationalInternal":{"tmp":"tmp/audience_0.0.1_1781127164794_0.5636571746897592","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"@absolutejs/audience","version":"0.0.2","author":"Alex Kahn","license":"BSL-1.1","_id":"@absolutejs/audience@0.0.2","maintainers":[{"name":"alexkahndev","email":"alexkahn2019@gmail.com"}],"dist":{"shasum":"65432ccb121752ba8592bf4f1065e8807ba42e5f","tarball":"https://registry.npmjs.org/@absolutejs/audience/-/audience-0.0.2.tgz","fileCount":9,"integrity":"sha512-ccuIOiKXwJrDGdkt9l8LZ82fjqrr+XzHg7YAEk0WE+AtPO+NMpHV8gmyeHSWYrTGXTtyC+FCjzzM41Er3Lgt1A==","signatures":[{"sig":"MEQCIBhzrI/tY+95wEYGonbZTQopZ0eMUjDx7gvfyl/sA0tyAiBipDGSchKC2mUp8Vk6AA+YuGTq4KBuwX0iUoCZ3Gp9uA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":21367},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","shasum":"65432ccb121752ba8592bf4f1065e8807ba42e5f","scripts":{"test":"bun test","build":"rm -rf dist && bun build src/index.ts --outdir dist --target=bun --external zod && tsc --emitDeclarationOnly --project tsconfig.json","release":"bun run build && bun publish","typecheck":"tsc --noEmit"},"_npmUser":{"name":"alexkahndev","email":"alexkahn2019@gmail.com"},"_integrity":"sha512-ccuIOiKXwJrDGdkt9l8LZ82fjqrr+XzHg7YAEk0WE+AtPO+NMpHV8gmyeHSWYrTGXTtyC+FCjzzM41Er3Lgt1A==","repository":{"url":"https://github.com/absolutejs/audience.git","type":"git"},"_npmVersion":"10.8.3","description":"In-house audience & affinity intelligence — psychographic inference, interest/brand affinity profiles, and audience-overlap scoring from public signals, provider- and embedding-injected, so you don't pay an audience-intelligence SaaS per seat.","directories":{},"_nodeVersion":"24.3.0","dependencies":{"zod":"^4.3.6"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"latest","typescript":"5.9.3"},"_npmOperationalInternal":{"tmp":"tmp/audience_0.0.2_1781132053743_0.5013724855166137","host":"s3://npm-registry-packages-npm-production"}},"0.0.3":{"name":"@absolutejs/audience","version":"0.0.3","author":"Alex Kahn","license":"BSL-1.1","_id":"@absolutejs/audience@0.0.3","maintainers":[{"name":"alexkahndev","email":"alexkahn2019@gmail.com"}],"dist":{"shasum":"740e8d6410997c70ede1434a419bb74eeb23778f","tarball":"https://registry.npmjs.org/@absolutejs/audience/-/audience-0.0.3.tgz","fileCount":12,"integrity":"sha512-Rp4DRsJ92QDdd+3p3d1FAJz8yAZU5irZBu8lSIu0ioTFMKyMuZS5RqR8n0yfFNdF4yf/Ias92UIDAwzKJzjRNA==","signatures":[{"sig":"MEUCIQCU+PVSKQYAdaOmQO/t7alqjwp4MZ2tDqiIS/iHCZU7CgIgDutQOSgQ1H7t5HMcvqn46qXu1eoCLFHNBCgT+WHvp58=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":388250},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","shasum":"740e8d6410997c70ede1434a419bb74eeb23778f","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"},"./manifest":{"types":"./dist/manifest.d.ts","import":"./dist/manifest.js","default":"./dist/manifest.js"},"./manifest.json":"./dist/manifest.json"},"scripts":{"test":"bun test","build":"rm -rf dist && bun build src/index.ts src/manifest.ts --outdir dist --root ./src --target=bun --external zod && tsc --emitDeclarationOnly --project tsconfig.json && absolute-manifest emit","release":"bun run build && bun publish","typecheck":"tsc --noEmit"},"_npmUser":{"name":"alexkahndev","email":"alexkahn2019@gmail.com"},"_integrity":"sha512-Rp4DRsJ92QDdd+3p3d1FAJz8yAZU5irZBu8lSIu0ioTFMKyMuZS5RqR8n0yfFNdF4yf/Ias92UIDAwzKJzjRNA==","absolutejs":{"manifestContract":1},"repository":{"url":"https://github.com/absolutejs/audience.git","type":"git"},"_npmVersion":"10.8.3","description":"In-house audience & affinity intelligence — psychographic inference, interest/brand affinity profiles, and audience-overlap scoring from public signals, provider- and embedding-injected, so you don't pay an audience-intelligence SaaS per seat.","directories":{},"_nodeVersion":"24.3.0","dependencies":{"zod":"^4.3.6","@sinclair/typebox":"^0.34.0","@absolutejs/manifest":"^0.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"latest","typescript":"5.9.3"},"_npmOperationalInternal":{"tmp":"tmp/audience_0.0.3_1783964700810_0.22663040910294652","host":"s3://npm-registry-packages-npm-production"}},"0.0.4":{"author":"Alex Kahn","description":"In-house audience & affinity intelligence — psychographic inference, interest/brand affinity profiles, and audience-overlap scoring from public signals, provider- and embedding-injected, so you don't pay an audience-intelligence SaaS per seat.","dependencies":{"zod":"^4.3.6","@absolutejs/manifest":"^0.4.0","@sinclair/typebox":"^0.34.0"},"devDependencies":{"@types/bun":"latest","typescript":"5.9.3"},"license":"BSL-1.1","main":"./dist/index.js","name":"@absolutejs/audience","publishConfig":{"access":"public"},"repository":{"type":"git","url":"https://github.com/absolutejs/audience.git"},"scripts":{"build":"rm -rf dist && bun build src/index.ts src/manifest.ts --outdir dist --root ./src --target=bun --external zod && tsc --emitDeclarationOnly --project tsconfig.json && absolute-manifest emit","release":"bun run build && bun publish","test":"bun test","typecheck":"tsc --noEmit"},"type":"module","types":"./dist/index.d.ts","version":"0.0.4","absolutejs":{"manifestContract":2},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"},"./manifest":{"types":"./dist/manifest.d.ts","import":"./dist/manifest.js","default":"./dist/manifest.js"},"./manifest.json":"./dist/manifest.json"},"_id":"@absolutejs/audience@0.0.4","_integrity":"sha512-fNMzn/n/d/YJqTUUaNZPP3T/w5ASimQWXqCjt3YFg4+78A39mXdSQomxfticUNzVud8wZqH6Q/Wbuz37j7iiiQ==","_nodeVersion":"24.3.0","_npmVersion":"10.8.3","shasum":"789e20262dcf77dacb07b5aada2f483d5a3ff3ff","dist":{"integrity":"sha512-fNMzn/n/d/YJqTUUaNZPP3T/w5ASimQWXqCjt3YFg4+78A39mXdSQomxfticUNzVud8wZqH6Q/Wbuz37j7iiiQ==","shasum":"789e20262dcf77dacb07b5aada2f483d5a3ff3ff","tarball":"https://registry.npmjs.org/@absolutejs/audience/-/audience-0.0.4.tgz","fileCount":12,"unpackedSize":392264,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIDlv1yHGFzrS9woLsZm+RQerPr5rUE7dSqDZxBC/6G4YAiEA+z0Ni5KRhLapMjnt5wSs3QnYA4q6ae8OJLvk7SwONuA="}]},"_npmUser":{"name":"alexkahndev","email":"alexkahn2019@gmail.com"},"directories":{},"maintainers":[{"name":"alexkahndev","email":"alexkahn2019@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/audience_0.0.4_1784846190565_0.7052795064684869"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-10T21:32:44.651Z","modified":"2026-07-23T22:36:30.886Z","0.0.1":"2026-06-10T21:32:44.918Z","0.0.2":"2026-06-10T22:54:13.885Z","0.0.3":"2026-07-13T17:45:00.947Z","0.0.4":"2026-07-23T22:36:30.742Z"},"author":"Alex Kahn","license":"BSL-1.1","repository":{"type":"git","url":"https://github.com/absolutejs/audience.git"},"description":"In-house audience & affinity intelligence — psychographic inference, interest/brand affinity profiles, and audience-overlap scoring from public signals, provider- and embedding-injected, so you don't pay an audience-intelligence SaaS per seat.","maintainers":[{"name":"alexkahndev","email":"alexkahn2019@gmail.com"}],"readme":"# @absolutejs/audience\n\nIn-house **audience & affinity intelligence** for AbsoluteJS apps — the\nownable parts of what an audience-intelligence SaaS sells, run on your own\nprovider and embedding model.\n\n- `inferPsychographics` — communication style, values, and motivations of a\n  person or brand from public signals (the \"how to approach them\" layer).\n- `profileAffinity` — a structured interest/brand affinity profile, embedded\n  into a vector.\n- `affinityOverlap` — a measured audience-overlap score between two profiles\n  (cosine of their embedded affinities) plus shared topics/brands. Pure, no\n  model call.\n- `cosineSimilarity` — the underlying vector math, exported.\n\nLike `@absolutejs/partnership`, every primitive is a pure function of typed\ninput plus an injected AI call. Affinity work also takes an injected `embed`\ncall, so the package never picks a provider or an embedding model — your app\nsupplies both, with its own metering and caching.\n\n## Install\n\n```sh\nbun add @absolutejs/audience\n```\n\n## Wiring\n\n```ts\nimport type { AudienceContext, GenerateObject } from \"@absolutejs/audience\";\nimport { meteredGenerateObjectAI } from \"./usage/meteredAI\";\nimport { aiProvider } from \"./integrations/aiProvider\";\nimport { embedTexts } from \"./integrations/ragStore\";\n\nexport const audienceCtx = (userSub?: string | null): AudienceContext => ({\n  embed: (texts) => embedTexts(texts, \"passage\"),\n  generateObject: ((req) =>\n    meteredGenerateObjectAI({ ...req, provider: aiProvider, userSub })) as GenerateObject,\n});\n```\n\n## Measuring audience overlap\n\n```ts\nimport { profileAffinity, affinityOverlap } from \"@absolutejs/audience\";\n\nconst me = await profileAffinity({ name: \"Me\", signals: { niche, offer } }, audienceCtx());\nconst them = await profileAffinity({ name: company, signals: { summary, industry } }, audienceCtx());\n\nconst { score, sharedTopics, rationale } = affinityOverlap(me, them);\n// score ∈ [0,1] — a *measured* overlap to use wherever you'd otherwise\n// have an LLM guess (e.g. a Trust & Fit \"audience overlap\" dimension).\n```\n\nFor a cheap inline path (no affinity extraction), embed two short descriptor\nstrings yourself and call `cosineSimilarity` directly.\n\n## License\n\nBSL 1.1 → Apache 2.0 on the Change Date (see `LICENSE`). Build your own apps and\nSaaS on top of it; you may not offer it as a competing hosted\naudience-intelligence service.\n","readmeFilename":"README.md"}