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

@mappa-ai/conduit

v0.2.2

Published

Official TypeScript/Node SDK for the Conduit API

Readme

@mappa-ai/conduit

Behavioral intelligence for your app. Type-safe and webhook-first.

Install

npm install @mappa-ai/conduit

Scope

Stable SDK scope is intentionally small:

  • reports.create(...)
  • reports.get(...)
  • matching.create(...)
  • matching.get(...)
  • webhooks.verifySignature(...)
  • webhooks.parseEvent(...)

Use webhooks as your default completion path. Report generation can take ~150s.

Advanced stable primitives are available under conduit.primitives.entities, conduit.primitives.media, and conduit.primitives.jobs.

Stable primitive methods:

  • conduitClient.primitives.entities.get(...)
  • conduitClient.primitives.entities.list(...)
  • conduitClient.primitives.entities.update(...)
  • conduitClient.primitives.media.upload(...)
  • conduitClient.primitives.media.get(...)
  • conduitClient.primitives.media.list(...)
  • conduitClient.primitives.media.delete(...)
  • conduitClient.primitives.media.setRetentionLock(...)
  • conduitClient.primitives.jobs.get(...)
  • conduitClient.primitives.jobs.cancel(...)

Quickstart

import { Conduit } from "@mappa-ai/conduit"

const conduitClient = new Conduit({ apiKey: process.env.CONDUIT_API_KEY! })

await conduitClient.reports.create({
  output: { template: "general_report" },
  source: { url: "https://example.com/recording.wav" },
  target: { strategy: "dominant" },
  webhook: { url: "https://your-app.com/api/webhooks/conduit" },
})

export async function handleConduitWebhook(req: Request) {
  const payload = await req.text()

  await conduitClient.webhooks.verifySignature({
    payload,
    headers: Object.fromEntries(req.headers),
    secret: process.env.CONDUIT_WEBHOOK_SECRET!,
  })

  const event = conduitClient.webhooks.parseEvent(payload)
  if (event.type !== "report.completed") return

  const report = await conduitClient.reports.get(event.data.reportId)
  console.log(report.id, report.output.template)
}

reports.create(...) returns only after source materialization/upload succeeds and the job is accepted.

Create Sources

type ReportSource =
  | { mediaId: string }
  | { file: Blob | ArrayBuffer | Uint8Array | ReadableStream<Uint8Array>; label?: string }
  | { url: string; label?: string }
  | { path: string; label?: string }
  • source.url makes the SDK host runtime fetch the remote media and then upload it to Conduit.
  • source.path resolves relative to the current working directory in filesystem-capable runtimes.
  • The client timeout budget applies to remote fetch, upload, and API create unless you provide narrower controls around your own calls.
  • source.url, source.path, and ReadableStream uploads may buffer in memory in JavaScript runtimes before upload when streaming is not available end-to-end.

Stable primitives

Use primitives for advanced workflows, not onboarding.

Entities

  • get(entityId) fetches one stable speaker identity.
  • list({ limit, cursor }) uses cursor pagination. Default limit is 20, max limit is 100, ordering is latests first, and deleted entities are not included.
  • update(entityId, { label }) sets or clears the optional entity label.

Media

  • upload({ file | url | path, label? }) materializes the same official source shapes as reports.create(...) in supported runtimes.
  • list({ limit, cursor, includeDeleted }) uses cursor pagination. Default limit is 20, max limit is 100, ordering is latests first, and deleted media is excluded unless includeDeleted: true.
  • get(mediaId), delete(mediaId), and setRetentionLock(mediaId, locked) manage uploaded media.

Jobs

  • get(jobId) fetches the canonical job shape.
  • cancel(jobId) requests cancellation for an in-flight job.

Handle webhooks

import { Conduit } from "@mappa-ai/conduit"

const conduitClient = new Conduit({ apiKey: process.env.CONDUIT_API_KEY! })

export async function POST(req: Request): Promise<Response> {
  const payload = await req.text()

  await conduitClient.webhooks.verifySignature({
    payload,
    headers: Object.fromEntries(req.headers),
    secret: process.env.CONDUIT_WEBHOOK_SECRET!,
  })

  const event = conduitClient.webhooks.parseEvent(payload)
  const seen = await hasProcessedWebhookEvent(event.id)
  if (seen) return new Response("ok", { status: 200 })

  if (event.type !== "report.completed") return new Response("ok", { status: 200 })

  const report = await conduitClient.reports.get(event.data.reportId)
  await markWebhookEventProcessed(event.id)
  console.log(report.id)
  return new Response("ok", { status: 200 })
}

Fallback polling/streaming

Webhook flow is preferred. If you need synchronous control, use receipt handles.

const receipt = await conduitClient.reports.create({
  output: { template: "general_report" },
  source: { file: audioBytes, label: "call" },
  target: { strategy: "dominant" },
})

const report = await receipt.handle?.wait({ timeoutMs: 5 * 60_000 })

Error handling

The SDK throws typed errors with stable code values.

import {
  isConduitError,
  isRateLimitError,
  isRemoteFetchTimeoutError,
  isTimeoutError,
} from "@mappa-ai/conduit"

try {
  await conduitClient.reports.create({
    output: { template: "general_report" },
    source: { url: "https://example.com/recording.wav" },
    target: { strategy: "dominant" },
  })
} catch (err) {
  if (isRateLimitError(err)) console.error(err.retryAfterMs)
  if (isRemoteFetchTimeoutError(err)) console.error(err.url)
  if (isTimeoutError(err)) console.error(err.message)
  if (isConduitError(err)) console.error(err.code, err.requestId)
  throw err
}

Matching

import { Conduit } from "@mappa-ai/conduit"

const conduitClient = new Conduit({ apiKey: process.env.CONDUIT_API_KEY! })
const receipt = await conduitClient.matching.create({
  context: "behavioral_compatibility",
  target: { entityId: "entity_1" },
  group: [{ entityId: "entity_2" }],
  webhook: { url: "https://your-app.com/api/webhooks/conduit" },
})

const matching = await receipt.handle?.wait({ timeoutMs: 5 * 60_000 })
console.log(matching?.id, matching?.output.markdown)

Runtime matrix

| Runtime | source.file | source.url | source.path | receipt.handle.wait() | receipt.handle.stream() | webhooks.verifySignature() | | --- | --- | --- | --- | --- | --- | --- | | Node | Yes | Yes | Yes | Yes | Yes | Yes | | Bun | Yes | Yes | Yes | Yes | Yes | Yes | | Deno | Yes | Yes | No - throws UnsupportedRuntimeError | Yes | Yes | Yes | | Edge/worker runtime | Yes | Yes | No - throws UnsupportedRuntimeError | Yes | Yes | Yes | | Browser | Blocked by default unless dangerouslyAllowBrowser: true; if enabled, source.path throws UnsupportedRuntimeError | Blocked by default unless dangerouslyAllowBrowser: true | No - throws UnsupportedRuntimeError | Yes | Yes | Yes |

Questions? docs.conduit.mappa.ai