{"_id":"@aiidentity/sdk","name":"@aiidentity/sdk","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@aiidentity/sdk","version":"1.0.0","description":"Official SDK for AI Identity — verify AI agents, look up the public registry, verify MCP servers. Zero deps. Node 18+ / browsers / Cloudflare Workers / Deno / Bun / Vercel Edge.","license":"MIT","homepage":"https://aiidentity.org/sdk","repository":{"type":"git","url":"git+https://github.com/aiidentity/aiidentity-js.git"},"bugs":{"url":"https://github.com/aiidentity/aiidentity-js/issues"},"author":{"name":"AI Identity Organization","url":"https://aiidentity.org"},"keywords":["ai","identity","verification","passport","whois","agent","agentic","mcp","trust","registry","ai-identity"],"main":"./dist/index.js","module":"./dist/index.mjs","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"},"require":{"types":"./dist/index.d.ts","default":"./dist/index.js"}}},"sideEffects":false,"scripts":{"build":"tsup src/index.ts --format esm,cjs --dts --clean --target es2022","dev":"tsup src/index.ts --format esm,cjs --dts --watch --target es2022","test":"node --test tests/*.test.mjs","prepublishOnly":"npm run build && npm test"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"engines":{"node":">=18"},"devDependencies":{"tsup":"^8.0.0","typescript":"^5.5.0"},"_id":"@aiidentity/sdk@1.0.0","gitHead":"0fe264740cac1551459d55c5d00d9cfab5c692d5","_nodeVersion":"20.20.2","_npmVersion":"10.8.2","dist":{"integrity":"sha512-IcJM6PQzkA6l+iYOIdsHgmsfiRykAAog0Ct6rWahdD/VD6JBMcGNOFlsl94QU6ywN9H5xvZ+PMQCdLYFrvwIDg==","shasum":"fddad36f40702f86648bc4fd29afb48d03d0e451","tarball":"https://registry.npmjs.org/@aiidentity/sdk/-/sdk-1.0.0.tgz","fileCount":8,"unpackedSize":35049,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@aiidentity%2fsdk@1.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIFQdXnAsA6s4HtgocM28YrrGp87mf7b9BpqLx2TfQxRbAiB1iejYUIq8u6aFZaVMR7UdtC6B84OOt3D6ZWUTnDdpdQ=="}]},"_npmUser":{"name":"aiidentity","email":"npm@aiidentity.org"},"directories":{},"maintainers":[{"name":"aiidentity","email":"npm@aiidentity.org"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sdk_1.0.0_1777979428571_0.5534993946016"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-05T11:10:28.510Z","1.0.0":"2026-05-05T11:10:28.735Z","modified":"2026-05-05T11:10:29.151Z"},"maintainers":[{"name":"aiidentity","email":"npm@aiidentity.org"}],"description":"Official SDK for AI Identity — verify AI agents, look up the public registry, verify MCP servers. Zero deps. Node 18+ / browsers / Cloudflare Workers / Deno / Bun / Vercel Edge.","homepage":"https://aiidentity.org/sdk","keywords":["ai","identity","verification","passport","whois","agent","agentic","mcp","trust","registry","ai-identity"],"repository":{"type":"git","url":"git+https://github.com/aiidentity/aiidentity-js.git"},"author":{"name":"AI Identity Organization","url":"https://aiidentity.org"},"bugs":{"url":"https://github.com/aiidentity/aiidentity-js/issues"},"license":"MIT","readme":"# `@aiidentity/sdk`\n\n[![npm version](https://img.shields.io/npm/v/@aiidentity/sdk.svg)](https://www.npmjs.com/package/@aiidentity/sdk)\n[![npm downloads](https://img.shields.io/npm/dm/@aiidentity/sdk.svg)](https://www.npmjs.com/package/@aiidentity/sdk)\n[![Bundle size](https://img.shields.io/bundlephobia/minzip/@aiidentity/sdk)](https://bundlephobia.com/package/@aiidentity/sdk)\n[![CI](https://github.com/aiidentity/aiidentity-js/actions/workflows/ci.yml/badge.svg)](https://github.com/aiidentity/aiidentity-js/actions/workflows/ci.yml)\n[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE)\n\nOfficial JavaScript / TypeScript SDK for [AI Identity](https://aiidentity.org) — the open verification standard, registry, and trust infrastructure for AI on the open web.\n\n> **Verify any AI in one line.**\n\n```ts\nimport { verify } from \"@aiidentity/sdk\";\n\nif ((await verify(passportToken)).valid) {\n  // It's the real ACME assistant.\n}\n```\n\n- **Zero runtime dependencies.** Nothing to audit, nothing to break.\n- **Universal.** Works in Node 18+, modern browsers, Cloudflare Workers, Deno, Bun, and Vercel Edge.\n- **Tiny.** ~2 KB gzipped.\n- **Typed.** First-class TypeScript with full result-type coverage.\n- **Provenance-published.** Every release is signed via [npm provenance](https://docs.npmjs.com/generating-provenance-statements).\n\n## Install\n\n```sh\nnpm install @aiidentity/sdk\n# or\npnpm add @aiidentity/sdk\n# or\nyarn add @aiidentity/sdk\n# or\nbun add @aiidentity/sdk\n```\n\n## Quick start\n\n### One-line helpers\n\n```ts\nimport { verify, whois } from \"@aiidentity/sdk\";\n\nconst result = await verify(\"eyJhbGciOiJFZERTQSI...\"); // a Passport JWT\nif (result.valid) {\n  console.log(`Verified: ${result.operator} (${result.tier})`);\n}\n\nconst record = await whois(\"aii_5q9k_abcd1234\");\nconsole.log(record?.display_name);\n```\n\n### Client (recommended for production)\n\nUse the client when you want to set an API key, custom base URL, or shared\ntimeout / user agent across many calls.\n\n```ts\nimport { AIIdentityClient } from \"@aiidentity/sdk\";\n\nconst ai = new AIIdentityClient({\n  apiKey: process.env.AII_API_KEY,   // optional; without it you get the public rate limit\n  timeoutMs: 5_000,\n  userAgent: \"my-app/1.2.3\",\n});\n\n// Verify a Passport JWT\nconst v1 = await ai.verify({ passport: passportJwt });\n\n// Or look up a bare identity by ID\nconst v2 = await ai.verify({ identity: \"aii_...\" });\n\n// Public WHOIS\nconst w = await ai.whois(\"aii_...\");\n\n// Current revocation list (cache it!)\nconst r = await ai.revocations();\n```\n\n## What it returns\n\n```ts\ntype VerifyResult = {\n  valid: boolean;\n  identity?: string;          // e.g. \"aii_...\"\n  tier?: \"issued\" | \"identity_verified\" | \"creator_verified\" | \"business_verified\";\n  operator?: string;          // e.g. \"ACME Corp\"\n  trust_score?: number;       // 0-100\n  status?: \"active\" | \"suspended\" | \"revoked\" | \"unknown\";\n  registry_url?: string;      // public WHOIS URL\n  passport?: { jti: string; exp: number };\n  reason?: string;            // when valid: false (e.g. \"signature_failed\", \"expired\")\n};\n```\n\n## Errors\n\nNetwork and HTTP failures throw `AIIdentityError`:\n\n```ts\nimport { AIIdentityClient, AIIdentityError } from \"@aiidentity/sdk\";\n\ntry {\n  const r = await new AIIdentityClient().verify({ passport: token });\n} catch (e) {\n  if (e instanceof AIIdentityError) {\n    console.error(`AI Identity error (${e.status}): ${e.code}`);\n  }\n}\n```\n\n## White-label\n\nIf you're consuming a white-labelled deployment, point the SDK at your own domain:\n\n```ts\nconst ai = new AIIdentityClient({ baseUrl: \"https://verify.example.com\" });\n```\n\n## Compatibility\n\n| Runtime              | Supported        |\n| -------------------- | ---------------- |\n| Node.js              | 18+              |\n| Modern browsers      | Yes (ESM + CJS)  |\n| Cloudflare Workers   | Yes              |\n| Vercel Edge Runtime  | Yes              |\n| Deno                 | Yes              |\n| Bun                  | Yes              |\n\nThe SDK uses only the WHATWG `fetch`, `URL`, and `AbortController` APIs — all\nuniversal as of 2024.\n\n## Versioning & stability\n\nFollows [semver](https://semver.org/). The 1.x line is **stable**: public\nexports won't change shape until 2.0. New methods may be added under minor\nversions. See [CHANGELOG.md](./CHANGELOG.md).\n\n## Contributing\n\nPRs welcome. See [CONTRIBUTING.md](./CONTRIBUTING.md). Security issues:\nplease email **security@aiidentity.org** rather than opening a public issue.\n\n## Related\n\n- **Spec & docs** → <https://aiidentity.org>\n- **HTTP API reference** → <https://aiidentity.org/spec/api>\n- **Public registry / WHOIS** → <https://aiidentity.org/whois>\n- **Embeddable badge** → <https://aiidentity.org/embed>\n\n## License\n\n[MIT](./LICENSE) © AI Identity Organization\n","readmeFilename":"README.md","_rev":"1-ef971813926257311508b667c59fb691"}