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

ciphyrs

v2.4.1

Published

Official Ciphyrs SDK for Node.js — agent tracing, observability, and PII detection

Downloads

51

Readme

@ciphyrs/sdk

Official Node.js SDK for Ciphyrs -- agent tracing, observability, and PII detection.

Installation

npm install @ciphyrs/sdk

Quick Start

Basic Tracing

import { CiphyrsClient } from '@ciphyrs/sdk';

const client = new CiphyrsClient({
  apiKey: 'ck_your_key',
  project: 'my-project',
});

await client.trace('research_pipeline', async (t) => {
  t.trigger_input = 'What is quantum computing?';

  const result = await client.span('Researcher', 'llm_call', async (s) => {
    s.setInput('What is quantum computing?');
    const answer = await llm.complete('What is quantum computing?');
    s.setOutput(answer);
    s.setTokens({ promptTokens: 50, completionTokens: 200 });
    return answer;
  });

  const summary = await client.span('Summarizer', 'llm_call', async (s) => {
    s.setInput(result);
    const out = await llm.complete(`Summarize: ${result}`);
    s.setOutput(out);
    return out;
  });

  t.final_output = summary;
});

Higher-Order Function Wrappers

import { CiphyrsClient, withTrace, withSpan, setDefaultClient } from '@ciphyrs/sdk';

const client = new CiphyrsClient({ apiKey: 'ck_your_key', project: 'my-project' });
setDefaultClient(client);

const research = withSpan('Researcher', 'llm_call', async (s, query) => {
  s.setInput(query);
  const result = await llm.complete(query);
  s.setOutput(result);
  return result;
});

const runPipeline = withTrace('research_task', async (t, query) => {
  t.trigger_input = query;
  const result = await research(query);
  t.final_output = result;
  return result;
});

await runPipeline('What is AI?');

OpenAI Auto-Tracing

import { CiphyrsClient } from '@ciphyrs/sdk';
import { patchOpenAI } from '@ciphyrs/sdk/integrations/openai';
import OpenAI from 'openai';

const ciphyrs = new CiphyrsClient({ apiKey: 'ck_your_key', project: 'my-project' });
const openai = new OpenAI();

patchOpenAI(openai, ciphyrs);

// All OpenAI calls inside a trace are automatically captured
await ciphyrs.trace('chat_pipeline', async () => {
  const response = await openai.chat.completions.create({
    model: 'gpt-4',
    messages: [{ role: 'user', content: 'Hello!' }],
  });
});

LangChain Integration

import { CiphyrsClient } from '@ciphyrs/sdk';
import { CiphyrsCallbackHandler } from '@ciphyrs/sdk/integrations/langchain';

const client = new CiphyrsClient({ apiKey: 'ck_your_key', project: 'my-project' });
const handler = new CiphyrsCallbackHandler({ client, traceName: 'langchain_run' });

const result = await chain.invoke(
  { input: 'What is AI?' },
  { callbacks: [handler] },
);

await handler.flush();

Direct Ingestion

const client = new CiphyrsClient({ apiKey: 'ck_your_key' });

await client.ingest(
  { name: 'my-project', framework: 'custom' },
  {
    trace_id: 'abc-123',
    name: 'my-trace',
    status: 'completed',
  },
  [
    {
      span_id: 'span-1',
      agent_name: 'MyAgent',
      kind: 'agent',
      input: 'hello',
      output: 'world',
      duration_ms: 150,
      status: 'ok',
    },
  ],
);

Span Kinds

| Kind | Description | |------|-------------| | agent | An autonomous agent step | | llm_call | A call to an LLM (OpenAI, Anthropic, etc.) | | tool_call | A tool/function invocation | | retrieval | A vector DB or search query |

Configuration

const client = new CiphyrsClient({
  apiKey: 'ck_your_key',
  baseUrl: 'https://api.ciphyrs.com',  // or self-hosted URL
  project: 'my-project',
  framework: 'langchain',
  maxBufferSize: 10,      // flush after 10 traces
  flushInterval: 30000,   // auto-flush every 30 seconds
  maxRetries: 3,          // retry failed requests
});

Context Propagation

The SDK uses Node.js AsyncLocalStorage for automatic context propagation. Spans created inside a trace() are automatically associated with it, and nested spans correctly track parent-child relationships -- even across async boundaries.

License

MIT