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

rakshex-sdk

v0.1.0

Published

Rakshex AI Runtime Telemetry SDK — drop-in wrapper for LLM providers

Readme

@rakshex/sdk

AI Runtime Telemetry SDK — drop-in wrapper for OpenAI and Anthropic SDKs that captures prompts, responses, tokens, cost, and latency and sends them to the Rakshex monitoring platform.

Quickstart

import { Rakshex } from "@rakshex/sdk";
import OpenAI from "openai";

const dp = new Rakshex({
  apiKey: "dp_xxx",
  workspaceId: "ws_xxx",
});

const openai = dp.wrap(new OpenAI());

const response = await openai.chat.completions.create({
  model: "gpt-4o",
  messages: [{ role: "user", content: "Hello!" }],
});
// Telemetry automatically captured and sent in batches

Installation

npm install @rakshex/sdk

Configuration

| Option | Type | Default | Description | | ----------------- | --------- | -------------------------------------------- | -------------------------------------- | | apiKey | string | required | Rakshex API key | | workspaceId | string | required | Workspace to report to | | ingestUrl | string | https://api.rakshex.in/v2/telemetry/events | Ingest endpoint | | sampleRate | number | 1.0 | Fraction of calls to capture (0.0–1.0) | | redactPII | boolean | true | Strip PII before sending | | batchSize | number | 50 | Max events per batch | | flushIntervalMs | number | 5000 | Auto-flush interval | | maxRetries | number | 3 | Retries with exponential backoff | | timeoutMs | number | 10000 | HTTP request timeout |

Supported Providers

| Provider | Auto-Detect | Wrapper | | ------------------------- | ------------------------- | ------------------------------------------------------------- | | OpenAI | ✅ | dp.wrap(openai) or wrapOpenAI(openai, collector) | | Anthropic | ✅ | dp.wrap(anthropic) or wrapAnthropic(anthropic, collector) | | AWS Bedrock | Manual capture | dp.capture(event) | | Google Vertex | Manual capture | dp.capture(event) | | Groq / Mistral / DeepSeek | Via OpenAI-compatible API | dp.wrap(client) |

PII Redaction

When redactPII is enabled (default), the following patterns are stripped client-side before any data leaves your environment:

  • Email addresses → [EMAIL_REDACTED]
  • Phone numbers → [PHONE_REDACTED]
  • SSN (US) → [SSN_REDACTED]
  • Credit card numbers → [CREDIT_CARD_REDACTED]
  • IP addresses → [IP_REDACTED]
  • API keys (OpenAI, xAI, Google) → [API_KEY_REDACTED]
  • JWT tokens → [JWT_REDACTED]
  • AWS access keys → [AWS_KEY_REDACTED]
  • Indian PII (DPDP 2023): Aadhaar, PAN, IFSC, passport numbers

Manual Capture

For providers without wrappers or custom instrumentation:

dp.capture({
  provider: "bedrock",
  model: "us.anthropic.claude-3-5-sonnet-20241022",
  inputTokens: 1500,
  outputTokens: 600,
  cachedTokens: 0,
  latencyMs: 2300,
  status: "ok",
  agentId: "my-agent",
  toolCalls: null,
  metadata: { customer_id: "acme" },
});

Shutdown

Call dp.shutdown() before process exit to flush remaining events:

process.on("SIGTERM", async () => {
  await dp.shutdown();
  process.exit(0);
});

License

MIT