SDKs & Libraries

Official client libraries for TypeScript/Node.js and Python.

TypeScript / Node.js SDK

Package: @listenbrief/sdk · source-available, npm publish planned

Installation (from source)

git clone https://gitlab.com/zamforge/small_projects.git
cd small_projects/sdk/typescript
npm install
npm run build
# In your project:
npm install /absolute/path/to/small_projects/sdk/typescript
Temporary: Until npm publish, use the source directly. The compiled dist/ is checked in and works in any Node.js 18+ project. REST/MCP integration works today — the SDK is a convenience layer.

Quick example

import { ListenBriefClient } from '@listenbrief/sdk';

const client = new ListenBriefClient({ apiKey: process.env.LISTENBRIEF_API_KEY });

const profile = await client.profiles.create({
  name: 'Daily Briefing',
  interests: ['AI', 'crypto'],
});

const briefing = await client.briefings.generate({ profile_id: profile.id });

console.log('Job ID:', briefing.job_id);

Features

Webhook verification

import { verifyWebhookSignature } from '@listenbrief/sdk/webhooks';

const valid = await verifyWebhookSignature(
  req.headers,
  body,
  process.env.WEBHOOK_SECRET
);

Python SDK

Package: listenbrief · source-available, PyPI publish planned

Installation (from source)

git clone https://gitlab.com/zamforge/small_projects.git
cd small_projects/sdk/python
pip install -e .
# Or in your requirements.txt:
-e git+https://gitlab.com/zamforge/small_projects.git#subdirectory=sdk/python
Temporary: Until PyPI publish, install from source. Requires Python 3.10+. REST/MCP integration works today via the OpenAPI spec + any HTTP client.

Sync example

from listenbrief import ListenBriefClient

client = ListenBriefClient(api_key=os.environ["LISTENBRIEF_API_KEY"])

profile = client.profiles.create(name="Daily Briefing", interests=["AI", "crypto"])
briefing = client.briefings.generate(profile_id=profile.id)

print("Job ID:", briefing.job_id)

Async example

from listenbrief import AsyncListenBriefClient

async with AsyncListenBriefClient(api_key=...) as client:
    profile = await client.profiles.create(
        name="Daily Briefing",
        interests=["AI", "crypto"]
    )

Features

Webhook verification

from listenbrief.webhooks import verify_webhook_signature

valid = verify_webhook_signature(
    headers=req.headers,
    body=body,
    secret=WEBHOOK_SECRET
)
Source code for both SDKs is in the repository under sdk/typescript/ and sdk/python/. PRs welcome.