Mo Elzubeir 252ea713b1 feat: add entity analytics, pluggable cache, and pitfalls docs
- Add Cache interface with MemoryCache and NoopCache implementations
- Make SocialhoseClient accept injectable cache option
- Remove Next.js next.revalidate coupling from transport
- Add entity analytics: getEntityBrief, getEntityStats, getEntityBriefs,
  getCampaignIdByMatch with exact sentiment/platform faceting and
  cumulative-differenced timeline
- Add 23 new tests (29 total) covering entity analytics, cache injection,
  sentiment reconciliation, bounded concurrency, and timeline differencing
- Update README with entity analytics, custom caching, and pitfalls sections
- Fix CI branch: main -> master
2026-05-29 13:10:05 -05:00

Socialhose SDKs

Official SDKs for the Socialhose Public API.

SDKs

  • sdks/javascript — npm package @socialhose/api

Future SDKs can live beside it, e.g. sdks/python, sdks/go, or sdks/php.

JavaScript / TypeScript

npm install @socialhose/api
import { SocialhoseClient } from '@socialhose/api';

const socialhose = new SocialhoseClient({
  apiKey: process.env.SOCIALHOSE_API_KEY!,
});

const mentions = await socialhose.getMentions({
  content_search: 'hospital',
  ordering: '-published_at',
});

console.log(mentions.count);

Development

Use pnpm 9.x.

pnpm install
pnpm test
pnpm typecheck
pnpm build

On machines where Corepack's pnpm shim is broken, use:

npx --yes pnpm@9.15.0 install
npx --yes pnpm@9.15.0 test

Publishing JavaScript SDK

cd sdks/javascript
pnpm test
pnpm typecheck
pnpm build
npm publish --access public --provenance

Do not publish 1.0.0 until the API endpoint inventory is complete and at least two real consumers have migrated.

S
Description
Official SDKs for the Socialhose Public API.
https://socialhose.net/api/public/v1/docs/
Readme 96 KiB
Languages
TypeScript 100%