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

@respan/respan

v2.5.0

Published

Respan unified SDK — entry point with plugin system for OTEL & OpenInference instrumentors

Readme

Respan TypeScript SDK

respan.ai | Documentation | npm

@respan/respan is the unified TypeScript and JavaScript entry point for Respan tracing, lifecycle management, context propagation, and first-party instrumentation plugins. It automatically discovers eligible direct LLM SDK adapters while keeping frameworks, agents, wrappers, and observability bridges explicit to avoid duplicate spans.

Installation

Install the facade and your provider SDK. For OpenAI:

npm install @respan/respan openai

Replace openai with the provider SDK your application uses. A normal @respan/respan install includes the supported first-party instrumentation adapters as optional dependencies. Do not use --omit=optional when you want automatic discovery.

Automatic Onboarding

Set your Respan credentials:

export RESPAN_API_KEY="your-api-key-here"
# Optional; this is also the Respan gateway base URL used below.
export RESPAN_BASE_URL="https://api.respan.ai/api"

Construct and initialize Respan before the first provider call. TypeScript initialization is asynchronous and must be awaited:

import OpenAI from "openai";
import { Respan } from "@respan/respan";

const respanBaseURL =
  process.env.RESPAN_BASE_URL ?? "https://api.respan.ai/api";

// Omit `instrumentations` to use curated direct-LLM automatic discovery.
const respan = new Respan({
  apiKey: process.env.RESPAN_API_KEY,
  baseURL: respanBaseURL,
});
await respan.initialize();

const client = new OpenAI({
  apiKey: process.env.RESPAN_API_KEY,
  baseURL: respanBaseURL,
});

const response = await client.chat.completions.create({
  model: "gpt-4.1-nano",
  messages: [{ role: "user", content: "Say hello in three languages." }],
});
console.log(response.choices[0].message.content);

console.table(respan.getInstrumentationStatus());
await respan.shutdown();

This example routes inference through the Respan gateway. When calling a provider directly, configure that provider's credentials and endpoint normally; Respan still reads RESPAN_API_KEY for telemetry export.

Automatically Supported Providers

The facade supplies these adapters. Install only the provider SDKs your application actually imports.

| Provider | Application SDK | |----------|-----------------| | OpenAI | openai | | Azure OpenAI | openai | | Anthropic | @anthropic-ai/sdk | | Vertex AI | @google-cloud/vertexai | | OpenRouter | @openrouter/sdk | | AWS Bedrock | @aws-sdk/client-bedrock-runtime | | Cohere | cohere-ai | | Together AI | together-ai | | Writer | writer-sdk |

Only registry entries classified as direct LLM integrations and enabled by default are activated. A missing provider SDK or adapter is reported as missing and does not stop initialization. Respan also disables overlapping generic instrumentation names to prevent duplicate spans.

Inspect Instrumentation Status

Call the status API after initialization:

for (const entry of respan.getInstrumentationStatus()) {
  console.log(entry.id, entry.status, entry.reason);
}

Each automatic registry entry includes its ID, category, provider, provider SDK, instrumentation package, instrumentor class, status, and optional reason. Status is one of enabled, disabled, missing, or failed.

The status list describes automatic discovery. Explicit plugins are not currently added to this list.

Control Automatic Discovery

Disable one automatic adapter by selector:

const respan = new Respan({
  disabledInstrumentations: ["openrouter"],
});
await respan.initialize();

Selectors are case-insensitive and can match a registry ID, provider, SDK package, instrumentation package, class name, or alias. Prefer a provider's registry ID. Use azure-openai to target Azure specifically; because OpenAI and Azure OpenAI both use the openai SDK package, the selector openai matches both. Use OpenAIInstrumentor when you need to disable only the non-Azure OpenAI adapter.

Passing an empty explicit list disables all automatic discovery:

const respan = new Respan({ instrumentations: [] });
await respan.initialize();

Explicit Framework and Agent Integrations

Frameworks, agents, wrappers, protocol/tooling integrations, observability bridges, and vector databases remain explicit to avoid duplicate provider and framework spans.

For example, OpenAI Agents uses an explicit plugin:

npm install @respan/respan @respan/instrumentation-openai-agents @openai/agents
import { Respan } from "@respan/respan";
import { OpenAIAgentsInstrumentor } from "@respan/instrumentation-openai-agents";

const respan = new Respan({
  instrumentations: [new OpenAIAgentsInstrumentor()],
});
await respan.initialize();

Supplying instrumentations, including an empty array, selects exclusive explicit mode and suppresses automatic discovery. TypeScript currently has no switch for combining explicit plugins with all automatic direct-SDK adapters.

Lifecycle and Helpers

  • await respan.initialize() starts telemetry and activates plugins. Call it before the first provider request.
  • await respan.flush() exports buffered spans without deactivating plugins.
  • await respan.shutdown() deactivates plugins and shuts down telemetry.
  • getInstrumentationStatus() returns automatic discovery results.
  • withWorkflow, withTask, withAgent, withTool, and propagateAttributes are re-exported from @respan/tracing.

Examples

Public API

The package exports Respan, registry and status types, OTELInstrumentor, OpenInferenceInstrumentor, tracing helpers, the Respan client, the span buffer manager, and processor configuration types.

License

Apache 2.0 — see the repository LICENSE.

Support