npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@absolutejs/audience-audiense

v0.0.1

Published

Audiense adapter for @absolutejs/audience — implements the AudienceSource contract against the Audiense Insights API (reports, demographics, affinities, influencers, audience overlap). The premium social-graph backfill for AbsoluteJS audience intelligence

Readme

@absolutejs/audience-audiense

Audiense adapter for @absolutejs/audience. Implements the AudienceSource contract against the Audiense Insights API — reports, demographics, influencer/brand affinities, and audience overlap — so an AbsoluteJS app can use measured audience intelligence wherever it otherwise derives it (e.g. the Trust & Fit / OPA audience-overlap signal).

This is the premium social-graph backfill: the parts of audience intelligence you can't derive yourself (Audiense's proprietary follower/affinity graph), behind the same interface as the own-it primitives.

Install

bun add @absolutejs/audience-audiense @absolutejs/audience

Use

import { audienseSource } from "@absolutejs/audience-audiense";

const audience = audienseSource({
  clientId: process.env.AUDIENSE_CLIENT_ID!,
  clientSecret: process.env.AUDIENSE_CLIENT_SECRET!,
  defaultBaselineId: process.env.AUDIENSE_BASELINE_ID, // baseline to compare affinities against
});

const reports = await audience.listAudiences?.();
const profile = await audience.getAudience?.(reports![0]);   // size, segments, demographics, affinities
const overlap = await audience.overlap?.(reportA, reportB);  // { score, sharedAffinities, method }

Every method is optional on AudienceSource, so consumers feature-detect:

const score = audience.overlap
  ? (await audience.overlap(a, b)).score   // measured, from Audiense
  : affinityOverlap(profA, profB).score;   // derived fallback (@absolutejs/audience)

Auth

Client-credentials OAuth: POST {baseUrl}/login/token with Authorization: Basic base64(clientId:clientSecret) and grant_type=client_credentials. The returned bearer token is cached until just before it expires. Get credentials from your Audiense account (or your Audiense data-partnership contact).

Config

| Field | Default | Notes | | --- | --- | --- | | clientId / clientSecret | — | Audiense API credentials (required). | | baseUrl | https://api.audiense.com/v1 | Override for a partnership/sandbox feed. | | defaultBaselineId | — | Baseline audience to compare affinities against; override per call via a ref's meta.baselineId. | | fetch | global fetch | Inject for tests / custom runtimes. | | now | Date.now | Inject a clock for tests. |

Overlap

Audiense exposes no two-audience intersection endpoint at the API tier this adapter targets (it's a UI report), so overlap is computed from shared affinities (affinityItemsOverlap from @absolutejs/audience — a weighted cosine over the two affinity graphs, plus the shared items). If your data partnership grants a native intersection endpoint, swap it in at the overlap implementation.

Field-mapping note

Response shapes are modeled from Audiense's own official client (audienseco/mcp-audiense-insights). A few field names weren't public, so the types are tolerant and the mappers degrade gracefully when a field is absent. Confirm exact field names against the live API (or your partnership feed) — the mappers are centralized in src/index.ts.

License

Apache-2.0. It only has value riding @absolutejs/audience, so it's permissive (per the AbsoluteJS adapter-tier policy).