{"_id":"@authai-io/relay","name":"@authai-io/relay","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@authai-io/relay","version":"0.1.0","description":"AuthAI relay core — Hono app that runs the OAuth device-code flow, encrypts tokens, and proxies OpenAI-compatible model calls.","homepage":"https://authai.io","repository":{"type":"git","url":"git+https://github.com/authai-io/authai.git","directory":"packages/relay"},"license":"MIT","type":"module","main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"publishConfig":{"access":"public"},"dependencies":{"@hono/node-server":"^1.13.7","hono":"^4.6.12","jose":"^5.9.6","ulid":"^2.3.0"},"devDependencies":{"@types/node":"^22.10.1","typescript":"^5.6.3","vitest":"^2.1.8"},"scripts":{"build":"tsc -p tsconfig.json","test":"vitest run","test:watch":"vitest"},"_id":"@authai-io/relay@0.1.0","bugs":{"url":"https://github.com/authai-io/authai/issues"},"_integrity":"sha512-q95EklIU/A9XwemDrKcOZbAoWn/Ktt2SqyHGAsh+c/1GBGi7cFOabeGWiXuQrvcUMXmEox0G+y+32oMSWlPfZw==","_resolved":"/private/var/folders/y0/__p4774x4kz6qyzbll13zqwc0000gn/T/4e6f9b91b1361269b54c25ec4bc8b033/authai-io-relay-0.1.0.tgz","_from":"file:authai-io-relay-0.1.0.tgz","_nodeVersion":"22.22.2","_npmVersion":"10.9.7","dist":{"integrity":"sha512-q95EklIU/A9XwemDrKcOZbAoWn/Ktt2SqyHGAsh+c/1GBGi7cFOabeGWiXuQrvcUMXmEox0G+y+32oMSWlPfZw==","shasum":"226cefa1da6d10503e69636f7afa783387fa100e","tarball":"https://registry.npmjs.org/@authai-io/relay/-/relay-0.1.0.tgz","fileCount":94,"unpackedSize":252766,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCzQ/mR/NRsVcrzhfd4ZX3Qw2BIDG0S0zWxvsBCVXraAwIgZnq8Zq774qNzWF8/asT9alb0S4DMIb4Hxiu8/V/llmc="}]},"_npmUser":{"name":"riccardoio","email":"me@riccardo.io"},"directories":{},"maintainers":[{"name":"riccardoio","email":"me@riccardo.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/relay_0.1.0_1781035733488_0.3448008460169656"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-09T20:08:53.244Z","0.1.0":"2026-06-09T20:08:53.637Z","modified":"2026-06-09T20:08:53.879Z"},"maintainers":[{"name":"riccardoio","email":"me@riccardo.io"}],"description":"AuthAI relay core — Hono app that runs the OAuth device-code flow, encrypts tokens, and proxies OpenAI-compatible model calls.","homepage":"https://authai.io","repository":{"type":"git","url":"git+https://github.com/authai-io/authai.git","directory":"packages/relay"},"bugs":{"url":"https://github.com/authai-io/authai/issues"},"license":"MIT","readme":"# @authai-io/relay\n\nCore relay library for [AuthAI](https://authai.io). A Hono app that:\n\n1. Runs the OAuth device-code flow against ChatGPT, Grok, or GitHub Copilot.\n2. Encrypts each user's OAuth tokens with a per-record AES-256-GCM key (the key lives only in the user's JWT).\n3. Issues a session JWT to the client.\n4. Speaks OpenAI's wire format on `/v1/chat/completions`, `/v1/responses`, `/v1/models`, proxying to whichever provider the user signed in with.\n\n## Use this directly only if you're building a custom relay host\n\nFor self-hosting, use the pre-wired executable in [`apps/relay-server`](https://github.com/authai-io/authai/tree/main/apps/relay-server). For AuthAI Cloud, point your app at `https://relay.authai.io` and skip the install entirely — see https://authai.io.\n\n## Custom host example\n\n```ts\nimport { createRelayApp, startBackgroundSweep } from \"@authai-io/relay\";\nimport { createStore } from \"@authai-io/relay-store-sqlite\";\n\nconst store = await createStore({ url: \"./relay.db\" });\nconst app = createRelayApp({\n  store,\n  jwtSecret: new Uint8Array(Buffer.from(process.env.AUTH_AI_JWT_SECRET!, \"hex\")),\n  identitySecret: Buffer.from(process.env.AUTH_AI_IDENTITY_SECRET!, \"hex\"),\n  originator: \"my-app\",\n});\nstartBackgroundSweep(store);\n```\n\nPair with a Node runtime (`@hono/node-server`), Bun, or any Hono-compatible host.\n\nSee [docs/installation.md](https://github.com/authai-io/authai/blob/main/docs/installation.md) for the prebuilt path and [docs/security.md](https://github.com/authai-io/authai/blob/main/docs/security.md) for the threat model.\n","readmeFilename":"README.md","_rev":"1-2944d15782869a5813b18ec24699548f"}