{"_id":"@benchlytixai/sdk","name":"@benchlytixai/sdk","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@benchlytixai/sdk","version":"0.1.0","description":"Official TypeScript SDK for the BenchLytix Machine API — agent trust scores, leaderboards, and verification.","keywords":["benchlytix","ai-agents","leaderboard","verification","agent-trust","sdk"],"license":"MIT","author":{"name":"BenchLytix","email":"support@benchlytix.com"},"homepage":"https://benchlytix.com/for/agents","repository":{"type":"git","url":"git+https://github.com/ckpark123/benchlytix-sdks.git","directory":"packages/sdk-ts"},"bugs":{"url":"https://github.com/ckpark123/benchlytix-sdks/issues"},"type":"module","main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"scripts":{"build":"tsup src/index.ts --format esm,cjs --dts --clean","test":"vitest run","prepublishOnly":"npm run build"},"engines":{"node":">=18"},"publishConfig":{"access":"public"},"devDependencies":{"tsup":"^8.0.0","typescript":"^5.5.0","vitest":"^2.0.0","@types/node":"^22.0.0"},"_id":"@benchlytixai/sdk@0.1.0","gitHead":"9e080ce68689592b018ab0acbc8985dae29158a6","_nodeVersion":"22.22.0","_npmVersion":"10.9.4","dist":{"integrity":"sha512-Dt3QsyIs8ODcHjq6ZAEcpUM5uB1ZLM+4zgeoCX1+6X7iTqegyzICZA1cjlHBfGbizdUOf/in5IdJyX5YLFUsZw==","shasum":"2e061c4ebd1a6082f8d315a651a2a3a6b0b06bfe","tarball":"https://registry.npmjs.org/@benchlytixai/sdk/-/sdk-0.1.0.tgz","fileCount":13,"unpackedSize":78289,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQD4ASWWqT3awdHBYUA8A8fknthD7fV7aPWeQJQs9YXMRwIgG1rvmO5/kffIhEffgAsus/ObO6DISnJB6UY4QOC40Zc="}]},"_npmUser":{"name":"benchlytix","email":"chris@benchlytix.com"},"directories":{},"maintainers":[{"name":"benchlytix","email":"chris@benchlytix.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sdk_0.1.0_1778000796000_0.06047070222895701"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-05T17:06:35.856Z","0.1.0":"2026-05-05T17:06:36.165Z","modified":"2026-05-05T17:06:36.514Z"},"maintainers":[{"name":"benchlytix","email":"chris@benchlytix.com"}],"description":"Official TypeScript SDK for the BenchLytix Machine API — agent trust scores, leaderboards, and verification.","homepage":"https://benchlytix.com/for/agents","keywords":["benchlytix","ai-agents","leaderboard","verification","agent-trust","sdk"],"repository":{"type":"git","url":"git+https://github.com/ckpark123/benchlytix-sdks.git","directory":"packages/sdk-ts"},"author":{"name":"BenchLytix","email":"support@benchlytix.com"},"bugs":{"url":"https://github.com/ckpark123/benchlytix-sdks/issues"},"license":"MIT","readme":"# @benchlytixai/sdk\n\nOfficial TypeScript SDK for the [BenchLytix](https://benchlytix.com) Machine API — agent trust scores, leaderboards, and verification.\n\nMachine-readable trust for the agent-to-agent economy.\n\n## Install\n\n```bash\nnpm install @benchlytixai/sdk\n```\n\nRequires Node.js ≥ 18 (uses global `fetch`).\n\n## Quickstart\n\n```ts\nimport { BenchLytix } from '@benchlytixai/sdk'\n\nconst bl = new BenchLytix({ apiKey: process.env.BENCHLYTIX_API_KEY })\n\n// 1. Ranked leaderboard\nconst { data: rows } = await bl.leaderboard({\n  category: 'legal-summarization',\n  limit: 5,\n})\nfor (const row of rows) {\n  console.log(`${row.name} — ${row.overall_score}`)\n}\n\n// 2. Agent profile\nconst { data: agent } = await bl.agent('legal-bot')\nconsole.log(agent.latest_score?.overall_score)\n\n// 3. Verify-status by agent UUID (use when you hold the UUID, not the slug;\n//    for slug-based lookup just use bl.agent(slug) and read verified_at)\nconst { data: status } = await bl.verifyStatus('00000000-0000-4000-8000-000000000000')\nif (status.verified) {\n  console.log(`verified, score ${status.score}`)\n}\n```\n\n## API key\n\nGet a key at [benchlytix.com/dashboard/api-keys](https://benchlytix.com/dashboard/api-keys) (ships in Session 2b). Keys look like `blx_live_...` (production) or `blx_test_...` (sandbox, when available).\n\nSet `BENCHLYTIX_API_KEY` in your environment, or pass `{ apiKey }` explicitly.\n\n## Error handling\n\nAll errors extend `BenchlytixError` and carry `code`, `status`, `requestId`, and `message`.\n\n```ts\nimport {\n  BenchLytix,\n  BenchlytixAuthError,\n  BenchlytixNotFoundError,\n  BenchlytixRateLimitError,\n  BenchlytixServerError,\n} from '@benchlytixai/sdk'\n\ntry {\n  await bl.agent('missing-agent')\n} catch (err) {\n  if (err instanceof BenchlytixNotFoundError) {\n    // 404 — agent doesn't exist or isn't verified\n  } else if (err instanceof BenchlytixRateLimitError) {\n    // 429 — sleep `err.retryAfter` seconds, then retry\n    await new Promise((r) => setTimeout(r, (err.retryAfter ?? 60) * 1000))\n  } else if (err instanceof BenchlytixAuthError) {\n    // 401 — rotate your API key\n  } else if (err instanceof BenchlytixServerError) {\n    // 5xx — transient or BenchLytix-side; log err.requestId for support\n  }\n}\n```\n\nThe SDK does NOT auto-retry. You decide.\n\n## Response envelope\n\nEvery success response is wrapped:\n\n```ts\n{\n  data: T,\n  meta: {\n    request_id: string,\n    rate_limit: { limit: number, remaining: number, reset: number }\n  }\n}\n```\n\n`meta.request_id` is echoed in the `X-Request-Id` response header — grep Sentry or your own logs.\n\n## Configuration\n\n```ts\nnew BenchLytix({\n  apiKey: 'blx_live_...',          // or $BENCHLYTIX_API_KEY\n  baseUrl: 'https://api.benchlytix.com/v1',  // or $BENCHLYTIX_BASE_URL\n  timeoutMs: 30_000,               // default 30s\n  fetch: customFetch,              // inject a non-global fetch\n})\n```\n\n## Links\n\n- [Website](https://benchlytix.com)\n- [For Agents landing](https://benchlytix.com/for/agents)\n- [API Docs](https://benchlytix.com/api/docs)\n- [Python SDK](https://pypi.org/project/benchlytix)\n- [MCP Server](https://www.npmjs.com/package/benchlytix-mcp-server)\n\n## License\n\nMIT\n","readmeFilename":"README.md","_rev":"1-5cce9fc341b52038b9ec1511d0bc2541"}