{"_id":"@agentmail/agentid-better-auth","_rev":"4-727941b90cd35faf1399f52e31f0fee9","name":"@agentmail/agentid-better-auth","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"@agentmail/agentid-better-auth","version":"0.1.0","keywords":["agentid","agentmail","better-auth","oauth","oidc","authentication","ai-agents"],"license":"MIT","_id":"@agentmail/agentid-better-auth@0.1.0","maintainers":[{"name":"tanishq-atm","email":"tanishq@agentmail.cc"},{"name":"sanjith_sambath","email":"sanjith@agentmail.cc"},{"name":"krishavg","email":"krishav@agentmail.cc"},{"name":"josephmaregn","email":"joseph@agentmail.cc"},{"name":"harry0915","email":"harry@agentmail.cc"},{"name":"shabs_agentmail","email":"shabs@agentmail.cc"},{"name":"agentmail-admin","email":"admin+npm@agentmail.cc"}],"homepage":"https://www.agentid.com/docs/better-auth","bugs":{"url":"https://github.com/agentmail-to/agentid-better-auth/issues"},"dist":{"shasum":"f01e84fc7894d5bbb6b879259295431ff6702aea","tarball":"https://registry.npmjs.org/@agentmail/agentid-better-auth/-/agentid-better-auth-0.1.0.tgz","fileCount":6,"integrity":"sha512-7BXyYWWWH2MZ7JzQbzRvuK+Ao3bZEAQlCC0Dw0tTtW8R49e1ws9BtvItKMbokAqEiICACUBwXykfGJ52eQrfPQ==","signatures":[{"sig":"MEUCIFBldX0GZhMgrQMiF41Ge7p/EQ89Yp7LTkxFCq8XzwK/AiEA1jfATCfW0BYg7Qfj83hUSWbqpq1e1y7DIADNj34WnUw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":10470},"main":"./dist/index.js","type":"module","_from":"file:agentmail-agentid-better-auth-0.1.0.tgz","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"scripts":{"test":"vitest run","build":"tsc -p tsconfig.build.json","check":"pnpm typecheck && pnpm test && pnpm build","typecheck":"tsc --noEmit"},"_npmUser":{"name":"agentmail-admin","email":"admin+npm@agentmail.cc"},"_resolved":"/private/var/folders/20/t0s64kyd33x28xf9ycv4fy6c0000gn/T/7dcf5e6d3db4411f01eafb00b500c936/agentmail-agentid-better-auth-0.1.0.tgz","_integrity":"sha512-7BXyYWWWH2MZ7JzQbzRvuK+Ao3bZEAQlCC0Dw0tTtW8R49e1ws9BtvItKMbokAqEiICACUBwXykfGJ52eQrfPQ==","repository":{"url":"git+https://github.com/agentmail-to/agentid-better-auth.git","type":"git"},"_npmVersion":"11.7.0","description":"AgentID provider helper for Better Auth's Generic OAuth plugin","directories":{},"sideEffects":false,"_nodeVersion":"25.4.0","dependencies":{"jose":"^6.2.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^3.2.4","typescript":"^5.9.2","better-auth":"1.7.2"},"peerDependencies":{"better-auth":">=1.7.2 <2"},"_npmOperationalInternal":{"tmp":"tmp/agentid-better-auth_0.1.0_1788293344295_0.1056396265112225","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@agentmail/agentid-better-auth","version":"0.1.1","keywords":["agentid","agentmail","better-auth","oauth","oidc","authentication","ai-agents"],"license":"MIT","_id":"@agentmail/agentid-better-auth@0.1.1","maintainers":[{"name":"tanishq-atm","email":"tanishq@agentmail.cc"},{"name":"sanjith_sambath","email":"sanjith@agentmail.cc"},{"name":"krishavg","email":"krishav@agentmail.cc"},{"name":"josephmaregn","email":"joseph@agentmail.cc"},{"name":"harry0915","email":"harry@agentmail.cc"},{"name":"shabs_agentmail","email":"shabs@agentmail.cc"},{"name":"agentmail-admin","email":"admin+npm@agentmail.cc"}],"homepage":"https://www.agentid.com/docs/better-auth","bugs":{"url":"https://github.com/agentmail-to/agentid-better-auth/issues"},"dist":{"shasum":"45808492641408f26bdaa4e09ca56e6bc8f84463","tarball":"https://registry.npmjs.org/@agentmail/agentid-better-auth/-/agentid-better-auth-0.1.1.tgz","fileCount":6,"integrity":"sha512-YCEnaZGkHOXfB0azIgQ5P/ZOQXtN9znk+IJ3EfcsuuQQidhH91zB70tvcaYJmyiJgV00qiW6l7RZo98caTpGcw==","signatures":[{"sig":"MEUCIQCmjadPi1rgijrgACv5T8c7rjc+cx5rxemerT74ATnl8QIgHW0XgK2In1ExrlM1e24+qf3QuCai3Cev63aA2r/vxjw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCIBYAAnIUJcrvbFKzGuZj78vCJGq+DryraN7U5SKaaFyqAiEAmiVh2S0GU0E94bywVINkNYcp16MOmH0/Z7qy6zTNOQA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":10700},"main":"./dist/index.js","type":"module","_from":"file:agentmail-agentid-better-auth-0.1.1.tgz","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"scripts":{"test":"vitest run","build":"tsc -p tsconfig.build.json","check":"pnpm typecheck && pnpm test && pnpm build","typecheck":"tsc --noEmit"},"_npmUser":{"name":"agentmail-admin","email":"admin+npm@agentmail.cc"},"_resolved":"/private/var/folders/20/t0s64kyd33x28xf9ycv4fy6c0000gn/T/d00b8d2b6ba22ff97db8fba7d75e6732/agentmail-agentid-better-auth-0.1.1.tgz","_integrity":"sha512-YCEnaZGkHOXfB0azIgQ5P/ZOQXtN9znk+IJ3EfcsuuQQidhH91zB70tvcaYJmyiJgV00qiW6l7RZo98caTpGcw==","repository":{"url":"git+https://github.com/agentmail-to/agentid-better-auth.git","type":"git"},"_npmVersion":"11.7.0","description":"AgentID provider helper for Better Auth's Generic OAuth plugin","directories":{},"sideEffects":false,"_nodeVersion":"25.4.0","dependencies":{"jose":"^6.2.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^3.2.4","typescript":"^5.9.2","better-auth":"1.7.2"},"peerDependencies":{"better-auth":">=1.7.2 <2"},"_npmOperationalInternal":{"tmp":"tmp/agentid-better-auth_0.1.1_1788388765416_0.4521890029743947","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2026-09-01T20:09:03.890Z","modified":"2026-09-29T22:59:24.621Z","0.1.0":"2026-09-01T20:09:04.432Z","0.1.1":"2026-09-02T22:39:25.511Z"},"bugs":{"url":"https://github.com/agentmail-to/agentid-better-auth/issues"},"license":"MIT","homepage":"https://www.agentid.com/docs/better-auth","keywords":["agentid","agentmail","better-auth","oauth","oidc","authentication","ai-agents"],"repository":{"url":"git+https://github.com/agentmail-to/agentid-better-auth.git","type":"git"},"description":"AgentID provider helper for Better Auth's Generic OAuth plugin","maintainers":[{"email":"tanishq@agentmail.cc","name":"tanishq-atm"},{"email":"sanjith@agentmail.cc","name":"sanjith_sambath"},{"email":"krishav@agentmail.cc","name":"krishavg"},{"email":"joseph@agentmail.cc","name":"josephmaregn"},{"email":"harry@agentmail.cc","name":"harry0915"},{"email":"sid@agentmail.cc","name":"sidharth6"},{"email":"michael@agentmail.cc","name":"michaelkimhyun"},{"email":"shabs@agentmail.cc","name":"shabs_agentmail"},{"email":"admin+npm@agentmail.cc","name":"agentmail-admin"}],"readme":"# AgentID for Better Auth\n\n`@agentmail/agentid-better-auth` is an AgentID provider helper for Better\nAuth's Generic OAuth plugin. It lets AI agents sign in with their AgentMail\nidentity while Better Auth handles the OAuth callback and session.\n\n## Requirements\n\n- Better Auth 1.7.2 or later\n- An AgentID client from the [AgentID console](https://console.agentid.com)\n\n## Install\n\n```sh\npnpm add @agentmail/agentid-better-auth\n```\n\n## Configure\n\nRegister this callback URL in the AgentID console:\n\n```text\nhttps://yourapp.com/api/auth/callback/agentid\n```\n\nThen add the helper to Better Auth:\n\n```ts\nimport { agentid } from \"@agentmail/agentid-better-auth\";\nimport { betterAuth } from \"better-auth\";\nimport { genericOAuth } from \"better-auth/plugins\";\n\nexport const auth = betterAuth({\n\tplugins: [\n\t\tgenericOAuth({\n\t\t\tconfig: [\n\t\t\t\tagentid({\n\t\t\t\t\tclientId: process.env.AGENTID_CLIENT_ID!,\n\t\t\t\t\tclientSecret: process.env.AGENTID_CLIENT_SECRET!,\n\t\t\t\t}),\n\t\t\t],\n\t\t}),\n\t],\n});\n```\n\nUse your existing Better Auth client, or create one. No client plugin is\nrequired:\n\n```ts\nimport { createAuthClient } from \"better-auth/react\";\n\nexport const authClient = createAuthClient();\n```\n\nStart sign-in with the standard social-provider API:\n\n```ts\nawait authClient.signIn.social({\n\tprovider: \"agentid\",\n\tcallbackURL: \"/\",\n});\n```\n\nSee the [AgentID Better Auth guide](https://www.agentid.com/docs/better-auth)\nfor the complete setup.\n\n## Scopes and owner claims\n\nThe default scopes are `openid`, `email`, and `profile`. These identify the\nagent and expose its AgentMail address. To also request information about the\nhuman who owns the agent, add `owner_profile` and `owner_email`:\n\n```ts\nagentid({\n\tclientId: process.env.AGENTID_CLIENT_ID!,\n\tclientSecret: process.env.AGENTID_CLIENT_SECRET!,\n\tscopes: [\"openid\", \"email\", \"profile\", \"owner_profile\", \"owner_email\"],\n});\n```\n\nOwner claims are returned by AgentID's UserInfo endpoint and are available to\nBetter Auth callbacks in the raw OAuth profile. See the AgentID guide for an\nexample of reading them later with the stored access token.\n\n## Protocol details\n\n- Discovery: `https://auth.agentid.com/.well-known/openid-configuration`\n- Token endpoint authentication: `client_secret_basic`\n- PKCE: required (`S256`)\n- Callback path: `/api/auth/callback/agentid`\n- ID tokens: verified through AgentID's discovery metadata and JWKS\n\nAgentID does not echo an OIDC nonce in authorization-code ID tokens. The helper\ntherefore disables Better Auth's nonce binding for this provider and requires\nPKCE instead. Signature, issuer, audience, algorithm, and expiry validation\nremain enabled.\n\n## Development\n\n```sh\npnpm install\npnpm check\n```\n","readmeFilename":"README.md"}