{"_id":"@anvaya/sdk","name":"@anvaya/sdk","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@anvaya/sdk","version":"1.0.0","description":"Anvaya instrumentation SDK — capture execution traces from an AI application","license":"Apache-2.0","type":"module","main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"scripts":{"build":"tsc -p tsconfig.json","typecheck":"tsc -p tsconfig.json --noEmit"},"repository":{"type":"git","url":"git+https://github.com/siddhashutosh/anvaya.git","directory":"packages/sdk"},"author":{"name":"Ashutosh Siddh"},"homepage":"https://github.com/siddhashutosh/anvaya#readme","bugs":{"url":"https://github.com/siddhashutosh/anvaya/issues"},"engines":{"node":">=20"},"publishConfig":{"access":"public"},"keywords":["ai","llm","observability","tracing","instrumentation","sdk","opentelemetry","rag","agents"],"dependencies":{"@anvaya/core":"1.0.0"},"gitHead":"4602680a39422703faf1ac2d6661765943fc5bab","_id":"@anvaya/sdk@1.0.0","_nodeVersion":"24.14.1","_npmVersion":"11.11.0","dist":{"integrity":"sha512-xEcUGWfWVYAe+m6VWzcXaAjQ4RApowgcPdiKuNWo/q7sGvBG+euW8cNx+t8z4rYKYDL52gvloTN7RgctohTXEQ==","shasum":"87e746b5ccf8c46bef03dfca2b0f280af2e7542b","tarball":"https://registry.npmjs.org/@anvaya/sdk/-/sdk-1.0.0.tgz","fileCount":51,"unpackedSize":129418,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDunfw7CXRPR2ZnAfxCzpLpPsUkMQgL8K/19lUZncCYqAIgdYTlkDUHuHuCdA4DK9S1yM8LQMAd89tzKm0rtWJMIIo="}]},"_npmUser":{"name":"siddhashutosh","email":"siddhashutosh@gmail.com"},"directories":{},"maintainers":[{"name":"siddhashutosh","email":"siddhashutosh@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sdk_1.0.0_1785628705167_0.27181123051331246"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-01T23:58:25.064Z","1.0.0":"2026-08-01T23:58:25.344Z","modified":"2026-08-01T23:58:26.190Z"},"maintainers":[{"name":"siddhashutosh","email":"siddhashutosh@gmail.com"}],"description":"Anvaya instrumentation SDK — capture execution traces from an AI application","homepage":"https://github.com/siddhashutosh/anvaya#readme","keywords":["ai","llm","observability","tracing","instrumentation","sdk","opentelemetry","rag","agents"],"repository":{"type":"git","url":"git+https://github.com/siddhashutosh/anvaya.git","directory":"packages/sdk"},"author":{"name":"Ashutosh Siddh"},"bugs":{"url":"https://github.com/siddhashutosh/anvaya/issues"},"license":"Apache-2.0","readme":"# @anvaya/sdk\n\nInstrumentation SDK for **[Anvaya](https://github.com/siddhashutosh/anvaya)** — AI failure\nobservability. It captures execution traces from an AI application and ships them to an\nAnvaya collector, which names the failure and attributes it to the span that caused it.\n\n```bash\nnpm install @anvaya/sdk\n```\n\nRequires Node.js ≥ 20.\n\n## Usage\n\n```ts\nimport { init, observeLLM, observeRetrieval } from '@anvaya/sdk';\n\nconst anvaya = init({ endpoint: 'http://localhost:4319', service: 'my-app' });\n\nawait anvaya.trace('handle-request', async () => {\n  const docs = await observeRetrieval('search', { indexName: 'kb' },\n    () => store.search(query), (r) => ({ documents: r }));\n\n  return observeLLM('answer', { provider: 'anthropic', requestModel: 'claude-opus-5' },\n    () => client.messages.create({ ... }), extractAnthropic);\n});\n```\n\nYou need a collector running to receive the spans:\n\n```bash\ngit clone https://github.com/siddhashutosh/anvaya.git\ncd anvaya && npm install && npm run build && npm start\n```\n\nThe dashboard is served by the same process on `http://localhost:4319`.\n\n## Design guarantees\n\n**The SDK cannot break the app it observes.** It never throws and never blocks. If the\ncollector is down, slow, or was never started, your request completes at exactly the same\nspeed and spans are dropped rather than queued without bound. Stop the collector mid-run\nand nothing changes for your users.\n\n**Content capture is off by default.** Metadata alone — token counts, latencies, span\nshape, tool names — drives structural and statistical detection. Turn content capture on\nonly if you want the heuristic and judge tiers to inspect text.\n\n**Redaction runs in your process, before transport.** API keys, bearer tokens, private\nkeys, AWS keys, JWTs, emails, phone numbers, Luhn-valid card numbers and SSNs are removed\nbefore anything leaves your machine, then again server-side as defence in depth.\n\n## Not using this SDK?\n\nYou don't need it. If you already emit OpenTelemetry, POST straight to the collector:\n\n```\nPOST /v1/ingest    { \"format\": \"otel-genai\", \"service\": \"...\", \"spans\": [ ... ] }\n```\n\n`otel-genai` and `openinference` are both accepted.\n\n## Licence\n\nApache-2.0 — see [LICENSE](./LICENSE).\n","readmeFilename":"README.md","_rev":"1-8ef1f8a751f1b52306d88867c813b723"}