{"_id":"@agentryhq/typescript-sdk","_rev":"3-714d7b932fdd014dcb4d7f2dabc7ff31","name":"@agentryhq/typescript-sdk","dist-tags":{"latest":"0.1.2"},"versions":{"0.1.0":{"name":"@agentryhq/typescript-sdk","version":"0.1.0","keywords":["agentry","sdk","typescript","openapi","email"],"license":"Apache-2.0","_id":"@agentryhq/typescript-sdk@0.1.0","maintainers":[{"name":"tomgreeen","email":"tom@geerly.com"}],"homepage":"https://github.com/agentryhq/agentry/tree/main/packages/sdk-typescript#readme","bugs":{"url":"https://github.com/agentryhq/agentry/issues"},"dist":{"shasum":"c52fdb933f4c0641d1701b63412baa401b5c6fce","tarball":"https://registry.npmjs.org/@agentryhq/typescript-sdk/-/typescript-sdk-0.1.0.tgz","fileCount":51,"integrity":"sha512-dhoinliDXj56ZrKsA9bAUpKDeBE7jHmTjNWyh4/6VHbalakwWJbQ7f97y8KMbnR9PBioeog9t4tSBJe2vKjwPg==","signatures":[{"sig":"MEUCIQDcMGWoTvXX1klHH6ZF02HGjC55kvqKNrs7hrPfzl6+2QIgVnPKlASqCNCPFbo5kOtZGSf5/hKZOFrUriaqszqPsuo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":213092},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"gitHead":"8816ffaaea9d6c86f2200de0d014573ef112f2c3","private":false,"scripts":{"test":"vitest run","build":"node -e \"require('node:fs').rmSync('dist', { recursive: true, force: true })\" && tsc","typecheck":"tsc --noEmit","test:smoke":"vitest run src/smoke.test.ts"},"_npmUser":{"name":"tomgreeen","email":"tom@geerly.com"},"repository":{"url":"git+https://github.com/agentryhq/agentry.git","type":"git","directory":"packages/sdk-typescript"},"_npmVersion":"10.9.2","description":"TypeScript SDK for the Agentry API.","directories":{},"sideEffects":false,"_nodeVersion":"22.14.0","dependencies":{"openapi-fetch":"^0.17.0","@agentry/openapi-generated":"workspace:*","openapi-typescript-helpers":"^0.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^4.1.1","typescript":"~6.0.2","@types/node":"^25.5.0"},"_npmOperationalInternal":{"tmp":"tmp/typescript-sdk_0.1.0_1774792020006_0.9309430670581544","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@agentryhq/typescript-sdk","version":"0.1.1","keywords":["agentry","sdk","typescript","openapi","email"],"license":"Apache-2.0","_id":"@agentryhq/typescript-sdk@0.1.1","maintainers":[{"name":"tomgreeen","email":"tom@geerly.com"}],"homepage":"https://github.com/agentryhq/agentry/tree/main/packages/sdk-typescript#readme","bugs":{"url":"https://github.com/agentryhq/agentry/issues"},"dist":{"shasum":"feb755d1e50cd5596874f8e1707499793eb96740","tarball":"https://registry.npmjs.org/@agentryhq/typescript-sdk/-/typescript-sdk-0.1.1.tgz","fileCount":51,"integrity":"sha512-CSmXrRr4Dnr1jRdfvFSOlNDAwdZV/C85I1f30QjgDeFfrmCuqSkLLS22+RepiGETu903MH/1yxBr1cWd0ruXvw==","signatures":[{"sig":"MEQCICkdFJqyBMALtzMA6mUuULNaP2zBRI/ejp9HjkO8VjWbAiASse/l+sbODIx7nU6Svbo5iOwscWvqVLLDv5uhymUyTw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":222472},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"gitHead":"b12a58d13419039ddd6da911835a2c28efed7954","private":false,"scripts":{"test":"vitest run","build":"node -e \"require('node:fs').rmSync('dist', { recursive: true, force: true })\" && tsc","typecheck":"tsc --noEmit","test:smoke":"vitest run src/smoke.test.ts"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:cf9f5c99-a153-4f31-addc-598f43acb5e5"}},"repository":{"url":"git+https://github.com/agentryhq/agentry.git","type":"git","directory":"packages/sdk-typescript"},"_npmVersion":"11.13.0","description":"TypeScript SDK for the Agentry API.","directories":{},"sideEffects":false,"_nodeVersion":"20.20.2","dependencies":{"openapi-fetch":"^0.17.0","openapi-typescript-helpers":"^0.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^4.1.1","typescript":"~6.0.2","@types/node":"^25.5.0","@agentry/openapi-generated":"workspace:*"},"_npmOperationalInternal":{"tmp":"tmp/typescript-sdk_0.1.1_1777549367098_0.39735501572095444","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@agentryhq/typescript-sdk","version":"0.1.2","private":false,"type":"module","description":"TypeScript SDK for the Agentry API.","license":"Apache-2.0","keywords":["agentry","sdk","typescript","openapi","email"],"engines":{"node":">=20"},"repository":{"type":"git","url":"git+https://github.com/agentryhq/typescript-sdk.git"},"homepage":"https://github.com/agentryhq/typescript-sdk#readme","bugs":{"url":"https://github.com/agentryhq/typescript-sdk/issues"},"sideEffects":false,"publishConfig":{"access":"public"},"main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"scripts":{"build":"node -e \"require('node:fs').rmSync('dist', { recursive: true, force: true })\" && tsc","typecheck":"tsc --noEmit","test":"vitest run","test:smoke":"vitest run src/smoke.test.ts"},"dependencies":{"openapi-fetch":"^0.17.0","openapi-typescript-helpers":"^0.1.0"},"devDependencies":{"@agentry/openapi-generated":"workspace:*","@types/node":"^25.5.0","typescript":"~6.0.2","vitest":"^4.1.1"},"gitHead":"41e8534f976dd0e4d11938d2f28259899f19f838","_id":"@agentryhq/typescript-sdk@0.1.2","_nodeVersion":"20.20.2","_npmVersion":"11.13.0","dist":{"integrity":"sha512-hypw6XTuVTOHTY0dCpknI8JeO8O3mci2vgYxU4NqxovtrrOOnt20nucz9LTO2DWcQkZVwiReghR7VUpClKLwGQ==","shasum":"15081cd12ba8a939f802fb5ee8bc3a6ff6b5654e","tarball":"https://registry.npmjs.org/@agentryhq/typescript-sdk/-/typescript-sdk-0.1.2.tgz","fileCount":51,"unpackedSize":222417,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDrxo1PgUgWPdYfG1GwQ9wAX1n9zx8wDVWb53IMgxeCZgIgZgTAunOjrrm52tFhZK82jjTVv120QTfFYWjTQPVOKig="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:cf9f5c99-a153-4f31-addc-598f43acb5e5"}},"directories":{},"maintainers":[{"name":"tomgreeen","email":"tom@geerly.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/typescript-sdk_0.1.2_1777554436970_0.40582315635292243"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-29T13:46:59.900Z","modified":"2026-04-30T13:07:17.275Z","0.1.0":"2026-03-29T13:47:00.145Z","0.1.1":"2026-04-30T11:42:47.246Z","0.1.2":"2026-04-30T13:07:17.144Z"},"bugs":{"url":"https://github.com/agentryhq/typescript-sdk/issues"},"license":"Apache-2.0","homepage":"https://github.com/agentryhq/typescript-sdk#readme","keywords":["agentry","sdk","typescript","openapi","email"],"repository":{"type":"git","url":"git+https://github.com/agentryhq/typescript-sdk.git"},"description":"TypeScript SDK for the Agentry API.","maintainers":[{"name":"tomgreeen","email":"tom@geerly.com"}],"readme":"# `@agentryhq/typescript-sdk`\n\nType-safe TypeScript client for the Agentry API.\n\nThe SDK is backed by Agentry OpenAPI types and exposes:\n\n- ergonomic resource methods (`client.agent.inboxes.list()`, etc.)\n- scoped low-level methods (`client.agent.get(\"/inboxes\")`)\n- automatic auth header injection (`Bearer <apiKey>`)\n- retries with exponential backoff\n- request timeout and abort support\n- normalized `AgentryClientError` errors\n\n## Installation\n\n```bash\nnpm i @agentryhq/typescript-sdk\n```\n\n## Quickstart\n\n```ts\nimport { createAgentryClient } from \"@agentryhq/typescript-sdk\";\n\nconst client = createAgentryClient({\n\tbaseUrl: \"https://api.agentry.to\",\n\tapiKey: process.env.AGENTRY_API_KEY,\n});\n\nconst inboxes = await client.agent.inboxes.list();\nconst inbox = await client.agent.inboxes.get(\"support@example.com\");\nconst message = await client.agent.messages.getRaw(\n\t\"support@example.com\",\n\t\"msg_123\",\n);\n```\n\n## API style\n\nUse either style depending on your needs:\n\n1. **Ergonomic resource methods** (recommended):\n\n```ts\nawait client.agent.inboxes.list();\nawait client.human.auth.createUrl({\n\tbody: { provider: \"google_oauth\", human_user_id: \"user_123\" },\n});\nawait client.organization.pods.get(\"pod_123\");\n```\n\n2. **Scoped low-level methods** (typed, useful for advanced cases):\n\n```ts\n// Relative scoped path (preferred for low-level namespace calls)\nawait client.agent.get(\"/inboxes\");\n\n// Absolute OpenAPI path also works\nawait client.agent.get(\"/agent/v0/inboxes\");\n\n// Global raw client is available when you need full-path access\nawait client.raw.get(\"/agent/v0/inboxes\");\n```\n\n## Constructor options\n\n```ts\nconst client = createAgentryClient({\n\tbaseUrl: \"https://api.agentry.to\", // required\n\tapiKey: process.env.AGENTRY_API_KEY, // optional\n\ttimeoutMs: 60_000, // default: 60_000\n\tmaxRetries: 2, // default: 2\n\tretryBaseDelayMs: 150, // default: 150\n\theaders: { \"X-Custom-Header\": \"value\" }, // optional\n\tfetch: async (request) => fetch(request), // optional custom fetch\n\tlogger: consoleLikeLogger, // optional logger\n});\n```\n\n`logger` must implement:\n\n```ts\n{\n\tdebug(message: string, meta?: Record<string, unknown>): void;\n\tinfo(message: string, meta?: Record<string, unknown>): void;\n\twarn(message: string, meta?: Record<string, unknown>): void;\n\terror(message: string, meta?: Record<string, unknown>): void;\n}\n```\n\n## Error handling\n\nThe SDK throws `AgentryClientError` for API and network failures.\n\n```ts\nimport {\n\tAgentryClientError,\n\tcreateAgentryClient,\n} from \"@agentryhq/typescript-sdk\";\n\nconst client = createAgentryClient({\n\tbaseUrl: \"https://api.agentry.to\",\n\tapiKey: process.env.AGENTRY_API_KEY,\n});\n\ntry {\n\tawait client.agent.inboxes.list();\n} catch (error) {\n\tif (error instanceof AgentryClientError) {\n\t\tconsole.error(error.message);\n\t\tconsole.error(error.statusCode);\n\t\tconsole.error(error.code);\n\t\tconsole.error(error.errorBody);\n\t}\n\tthrow error;\n}\n```\n\n## Retries, timeout, and aborting\n\n- Retries are automatic for `408`, `429`, and `5xx` responses.\n- Retry count and base delay are configurable with `maxRetries` and `retryBaseDelayMs`.\n- Timeout is controlled with `timeoutMs`.\n- You can pass an `AbortSignal` in operation init via OpenAPI `init` options.\n\n## Development\n\nFrom the package directory:\n\n- install: `pnpm install`\n- build: `pnpm run build`\n- typecheck: `pnpm run typecheck`\n- test: `pnpm run test`\n\nOptional smoke tests against a deployed API:\n\n- set `AGENTRY_SDK_SMOKE=1`, `AGENTRY_SDK_SMOKE_BASE_URL`, `AGENTRY_SDK_SMOKE_API_KEY`\n- run `pnpm run test:smoke`\n\nOpenAPI parity and convenience-wrapper coverage gates run in monorepo CI before publishing.\n","readmeFilename":"README.md"}