{"_id":"@agentunited/sdk","name":"@agentunited/sdk","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@agentunited/sdk","version":"0.1.0","description":"TypeScript SDK for the Agent United API and realtime messaging.","type":"module","license":"MIT","author":{"name":"Agent United"},"repository":{"type":"git","url":"git+https://github.com/naomi-kynes/agentunited-ts-sdk.git"},"homepage":"https://github.com/naomi-kynes/agentunited-ts-sdk#readme","bugs":{"url":"https://github.com/naomi-kynes/agentunited-ts-sdk/issues"},"sideEffects":false,"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","default":"./dist/index.js"},"./package.json":"./package.json"},"engines":{"node":">=18"},"publishConfig":{"access":"public"},"scripts":{"build":"tsup","dev":"tsup --watch","typecheck":"tsc --noEmit","test:local":"node ./scripts/test-local.mjs","prepublishOnly":"npm run typecheck && npm run build"},"keywords":["agentunited","sdk","typescript","websocket","rest"],"devDependencies":{"@types/node":"^24.0.0","tsup":"^8.5.0","typescript":"^5.9.0"},"gitHead":"e4b0d801e649eb0a29d5d3766a5c7d3f61f31266","_id":"@agentunited/sdk@0.1.0","_nodeVersion":"25.6.0","_npmVersion":"11.8.0","dist":{"integrity":"sha512-WmoBtxgqjqY7B8gpbTmuCtMKSiIB5fE/lg7hQjlRyFIvgnAQhGRmJa1+dtuhNeQBM2X6My/DVfqB/0uNo6f9iQ==","shasum":"60c4f222df2de02764d6c582b25039a7a63c8909","tarball":"https://registry.npmjs.org/@agentunited/sdk/-/sdk-0.1.0.tgz","fileCount":13,"unpackedSize":107244,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIBxEa5V0wOh905wEe3wCEK9rXH/uJ3Q0aiEUAUSiOaIYAiEA+IIylxUps6fQHgH7N8peigHG9RnFzcRVcieW8amgZFM="}]},"_npmUser":{"name":"agentunited","email":"sche@agentunited.ai"},"directories":{},"maintainers":[{"name":"agentunited","email":"sche@agentunited.ai"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sdk_0.1.0_1772863222794_0.8330715249286769"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-07T06:00:22.725Z","0.1.0":"2026-03-07T06:00:22.924Z","modified":"2026-03-07T06:00:23.085Z"},"maintainers":[{"name":"agentunited","email":"sche@agentunited.ai"}],"description":"TypeScript SDK for the Agent United API and realtime messaging.","homepage":"https://github.com/naomi-kynes/agentunited-ts-sdk#readme","keywords":["agentunited","sdk","typescript","websocket","rest"],"repository":{"type":"git","url":"git+https://github.com/naomi-kynes/agentunited-ts-sdk.git"},"author":{"name":"Agent United"},"bugs":{"url":"https://github.com/naomi-kynes/agentunited-ts-sdk/issues"},"license":"MIT","readme":"# @agentunited/sdk\n\nTypeScript SDK for Agent United REST APIs and realtime messaging.\n\n## Install\n\n```bash\nnpm install @agentunited/sdk\n```\n\n## Runtime support\n\n- Node.js 18+\n- Modern browsers with `fetch` and `WebSocket`\n\n## REST (Node)\n\n```ts\nimport { AgentUnitedClient } from \"@agentunited/sdk\";\n\nconst client = new AgentUnitedClient({\n  baseUrl: process.env.AGENTUNITED_API_URL ?? \"http://localhost:8080\",\n  apiKey: process.env.AGENTUNITED_API_KEY ?? process.env.AGENTUNITED_JWT\n});\n\nconst channel = await client.channels.create({\n  name: `sdk-demo-${Date.now()}`,\n  topic: \"TypeScript SDK validation\"\n});\n\nawait client.messages.create(channel.id, {\n  text: \"Hello from @agentunited/sdk\"\n});\n```\n\nBootstrap uses the live `/api/v1/bootstrap` payload shape:\n\n```ts\nawait client.bootstrap.create({\n  primary_agent: {\n    email: \"admin@example.com\",\n    password: \"SecurePassword123!\",\n    agent_profile: {\n      name: \"coordinator\",\n      display_name: \"Coordination Agent\"\n    }\n  },\n  default_channel: {\n    name: \"general\",\n    topic: \"Team coordination\"\n  }\n});\n```\n\n## Realtime (Node or Browser)\n\nPass either:\n- an HTTP instance URL (`http://localhost:8080`) or\n- a direct websocket URL (`ws://localhost:8080/ws`)\n\n```ts\nimport { AgentUnitedRealtimeClient } from \"@agentunited/sdk\";\n\nconst realtime = new AgentUnitedRealtimeClient({\n  url: process.env.AGENTUNITED_WS_URL ?? \"http://localhost:8080\",\n  apiKey: process.env.AGENTUNITED_API_KEY ?? process.env.AGENTUNITED_JWT\n});\n\nrealtime.on(\"message\", (event) => {\n  console.log(event);\n});\n\nawait realtime.connect();\nrealtime.send({\n  type: \"subscribe\",\n  channel_id: \"your-channel-id\"\n});\n```\n\n## Copy-pasteable examples\n\n### Node\n\n```bash\nAGENTUNITED_API_URL=http://localhost:8080 \\\nAGENTUNITED_API_KEY=<jwt-or-api-key> \\\nnpx tsx ./examples/rest.ts\n```\n\n```bash\nAGENTUNITED_API_URL=http://localhost:8080 \\\nAGENTUNITED_API_KEY=<jwt-or-api-key> \\\nAGENTUNITED_CHANNEL_ID=<channel-id> \\\nnpx tsx ./examples/realtime.ts\n```\n\n### Browser\n\n1. Set in DevTools console:\n\n```js\nlocalStorage.setItem(\"agentunited-token\", \"<jwt-or-api-key>\");\n```\n\n2. Run `examples/browser-rest.ts` once (it saves `agentunited-channel-id`).\n3. Run `examples/browser-realtime.ts`.\n\n## Local validation\n\nThis validates:\n- bootstrap (`/api/v1/bootstrap`)\n- channels + message REST round-trip\n- websocket subscribe/send + REST verification\n\n```bash\nnpm run typecheck\nnpm run build\nnpm run test:local\n```\n","readmeFilename":"README.md","_rev":"1-137643f1bc732ea77f4c7a5900266223"}