@noryen/sdk
v1.1.2
Published
Open-source TypeScript SDK for Noryen AI trace tracking.
Maintainers
Readme
@noryen/sdk
TypeScript SDK for sending AI traces to Noryen so you can debug model behavior, latency and cost in production.
Install
npm install @noryen/sdkQuickstart
import { noryen } from "@noryen/sdk";
noryen.init({
apiKey: process.env.NORYEN_API_KEY!,
// optional: endpoint override
// endpoint: "https://your-api.example.com/v1/track",
});
noryen.track({
model: "gpt-4o-mini",
provider: "openai",
prompt: "Summarize this text in 3 bullets.",
response: "1) ... 2) ... 3) ...",
latency: 820,
cost: 0.0012,
metadata: { env: "prod", feature: "summary" },
});Endpoint Resolution
@noryen/sdk uses this priority order:
init({ endpoint })- Environment variables:
NORYEN_API_URLNORYEN_TRACK_ENDPOINTNEXT_PUBLIC_NORYEN_API_URL
- Hosted default
This keeps zero-config onboarding while still allowing self-hosting/override.
Provider Wrappers
@noryen/sdk includes wrappers to auto-track OpenAI, Anthropic, and Gemini calls.
import OpenAI from "openai";
import { noryen } from "@noryen/sdk";
noryen.init({ apiKey: process.env.NORYEN_API_KEY! });
const openai = noryen.wrapOpenAI(new OpenAI({ apiKey: process.env.OPENAI_API_KEY }));
await openai.chat.completions.create({
model: "gpt-4o-mini",
messages: [{ role: "user", content: "Write a haiku about testing." }],
});Local Development
npm ci
npm run check
npm run type-check
npm run buildOpen Source Contribution Flow
- Fork the repo
- Create a branch from
main - Make focused changes
- Run:
npm run checknpm run type-checknpm run build
- Open PR with context and verification notes
See CONTRIBUTING.md for full guidelines.
License
MIT, see LICENSE.
