{"_id":"@afterauth/sdk","_rev":"5-f69321f641ef1e5915730992b4a1daf1","name":"@afterauth/sdk","dist-tags":{"latest":"0.1.2"},"versions":{"0.0.2":{"name":"@afterauth/sdk","version":"0.0.2","_id":"@afterauth/sdk@0.0.2","maintainers":[{"name":"afterauth","email":"afterauth@gmail.com"}],"dist":{"shasum":"9b6f7668831ca55db07d7ddbedbe244a69915a34","tarball":"https://registry.npmjs.org/@afterauth/sdk/-/sdk-0.0.2.tgz","fileCount":4,"integrity":"sha512-ALVMtD+ls+mLs3uRiAXUqdZvuBEiPZ1e5DocF6ANb0ini/2QMloM91uwdamfuuEDbntKEBlLpmn2ZMnR8lDsfA==","signatures":[{"sig":"MEUCIQDZ90YdPa4nv219ZegdphN0XwEsVz3PZ589ZIu+KXjdfQIgMw/Xfi8sYguGnPL1QFHPeaKzaav4L2zEB7JqGQpSees=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":4765},"main":"./dist/index.js","type":"module","_from":"file:afterauth-sdk-0.0.2.tgz","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"dev":"tsc -p tsconfig.json --watch","test":"vitest run","build":"tsc -p tsconfig.json","typecheck":"tsc -p tsconfig.json --noEmit"},"_npmUser":{"name":"afterauth","email":"afterauth@gmail.com"},"_resolved":"/private/var/folders/b4/jxqd49m15fl4n9fqg0j43qzc0000gn/T/547328fa598cb7356c5379dafee804fc/afterauth-sdk-0.0.2.tgz","_integrity":"sha512-ALVMtD+ls+mLs3uRiAXUqdZvuBEiPZ1e5DocF6ANb0ini/2QMloM91uwdamfuuEDbntKEBlLpmn2ZMnR8lDsfA==","_npmVersion":"11.10.0","directories":{},"_nodeVersion":"25.6.0","dependencies":{"@afterauth/core":"0.0.2"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^2.1.8","typescript":"^5.7.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_0.0.2_1777526413853_0.6249774726648507","host":"s3://npm-registry-packages-npm-production"}},"0.0.3":{"name":"@afterauth/sdk","version":"0.0.3","_id":"@afterauth/sdk@0.0.3","maintainers":[{"name":"afterauth","email":"afterauth@gmail.com"}],"dist":{"shasum":"feb3373598e36e3482d45d0262e8b39a990c6d87","tarball":"https://registry.npmjs.org/@afterauth/sdk/-/sdk-0.0.3.tgz","fileCount":4,"integrity":"sha512-P/RbdwP7zkhAzYZ+jy+bQa38lMaw2LTjHyCZlZOZGKAXcgs7Wt1zDpUPekhsHYygMRECgvEnvMjRu5pSVAkAdg==","signatures":[{"sig":"MEQCIA/vj5iNQA/zMNoj09ZghVlG5bPTSVrKeBZEzllbm2e8AiAh6BkbhmSUI+GTV+yOZub31CFRmXtlA5h51TqD8Mc/Dg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":4739},"main":"./dist/index.js","type":"module","_from":"file:afterauth-sdk-0.0.3.tgz","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"dev":"tsc -p tsconfig.json --watch","test":"vitest run","build":"tsc -p tsconfig.json","typecheck":"tsc -p tsconfig.json --noEmit"},"_npmUser":{"name":"afterauth","email":"afterauth@gmail.com"},"_resolved":"/private/var/folders/b4/jxqd49m15fl4n9fqg0j43qzc0000gn/T/7f31a9d489192237be1329d0a4dac487/afterauth-sdk-0.0.3.tgz","_integrity":"sha512-P/RbdwP7zkhAzYZ+jy+bQa38lMaw2LTjHyCZlZOZGKAXcgs7Wt1zDpUPekhsHYygMRECgvEnvMjRu5pSVAkAdg==","_npmVersion":"11.10.0","directories":{},"_nodeVersion":"25.6.0","dependencies":{"@afterauth/core":"0.0.3"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^2.1.8","typescript":"^5.7.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_0.0.3_1777743036910_0.6534131895098647","host":"s3://npm-registry-packages-npm-production"}},"0.1.0":{"name":"@afterauth/sdk","version":"0.1.0","_id":"@afterauth/sdk@0.1.0","maintainers":[{"name":"afterauth","email":"afterauth@gmail.com"}],"dist":{"shasum":"0f7de88810f13c0bc2a0547726e69feb44429594","tarball":"https://registry.npmjs.org/@afterauth/sdk/-/sdk-0.1.0.tgz","fileCount":5,"integrity":"sha512-ELeHBeANSeI4GeP+WILUbtLXgfJzwrIMV48dk2y+Ka4RkvdoVnO85ZL259eSZlObTh+eWkV51FF2uTQVwjNprQ==","signatures":[{"sig":"MEUCIBXeBV5B3GmoiMR9MqPOlTEIObJcUAM8Piy5RiU9emtKAiEAyKHgWzYZXjSP4x7w96GakvKbcu8vqGydSi7YU/3t1fg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":6324},"main":"./dist/index.js","type":"module","_from":"file:afterauth-sdk-0.1.0.tgz","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"dev":"tsc -p tsconfig.json --watch","test":"vitest run","build":"tsc -p tsconfig.json","typecheck":"tsc -p tsconfig.json --noEmit"},"_npmUser":{"name":"afterauth","email":"afterauth@gmail.com"},"_resolved":"/private/var/folders/b4/jxqd49m15fl4n9fqg0j43qzc0000gn/T/2453e6b85f845257c605cde2f409c476/afterauth-sdk-0.1.0.tgz","_integrity":"sha512-ELeHBeANSeI4GeP+WILUbtLXgfJzwrIMV48dk2y+Ka4RkvdoVnO85ZL259eSZlObTh+eWkV51FF2uTQVwjNprQ==","_npmVersion":"11.10.0","directories":{},"_nodeVersion":"25.6.0","dependencies":{"@afterauth/core":"0.0.3"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^2.1.8","typescript":"^5.7.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_0.1.0_1777826087217_0.9852761787618534","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@afterauth/sdk","version":"0.1.1","_id":"@afterauth/sdk@0.1.1","maintainers":[{"name":"afterauth","email":"afterauth@gmail.com"}],"dist":{"shasum":"c76685ed69fd59d58cf6fc7028bc1dc366d56037","tarball":"https://registry.npmjs.org/@afterauth/sdk/-/sdk-0.1.1.tgz","fileCount":5,"integrity":"sha512-gf8GktLRsjpWYNVosjaq1gt4Q/INHTkPrUwbvpInCa9eVPyOtTcyCai9Iauyc2dsSWIidvJbaeCRmYJ8TJ4smg==","signatures":[{"sig":"MEUCIGimlzeJU3DC1v0ZxrbAOwPig05CeMGL0jNc2+8UAA/SAiEAxof8Zh62OE1XVePH22VIJnUPW8v6KOLu+xSn5j4DAww=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":8290},"main":"./dist/index.js","type":"module","_from":"file:afterauth-sdk-0.1.1.tgz","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"dev":"tsc -p tsconfig.json --watch","test":"vitest run","build":"tsc -p tsconfig.json","typecheck":"tsc -p tsconfig.json --noEmit"},"_npmUser":{"name":"afterauth","email":"afterauth@gmail.com"},"_resolved":"/private/var/folders/b4/jxqd49m15fl4n9fqg0j43qzc0000gn/T/dbf215a517843eb66e9bb553d3f9de9a/afterauth-sdk-0.1.1.tgz","_integrity":"sha512-gf8GktLRsjpWYNVosjaq1gt4Q/INHTkPrUwbvpInCa9eVPyOtTcyCai9Iauyc2dsSWIidvJbaeCRmYJ8TJ4smg==","_npmVersion":"11.10.0","directories":{},"_nodeVersion":"25.6.0","dependencies":{"@afterauth/core":"0.0.4"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^2.1.8","typescript":"^5.7.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_0.1.1_1778372190839_0.6942998035575976","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@afterauth/sdk","version":"0.1.2","type":"module","description":"Post-auth controls for costly AI, API, and trial usage","homepage":"https://afterauth.com","main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"dependencies":{"@afterauth/core":"0.0.4"},"devDependencies":{"typescript":"^5.7.2","vitest":"^2.1.8"},"scripts":{"build":"tsc -p tsconfig.json","dev":"tsc -p tsconfig.json --watch","typecheck":"tsc -p tsconfig.json --noEmit","test":"vitest run"},"_id":"@afterauth/sdk@0.1.2","_integrity":"sha512-3Gl5hNuQKDvrsYOE8IciQcXo/G/VpLhOkK5QGJETEYrhgPplWI//eHb9fja7v7WKyCF68+TWmgcQLQiLbJsQOg==","_resolved":"/private/var/folders/b4/jxqd49m15fl4n9fqg0j43qzc0000gn/T/e4df8d4f419769bafc856013840caf8d/afterauth-sdk-0.1.2.tgz","_from":"file:afterauth-sdk-0.1.2.tgz","_nodeVersion":"25.6.0","_npmVersion":"11.10.0","dist":{"integrity":"sha512-3Gl5hNuQKDvrsYOE8IciQcXo/G/VpLhOkK5QGJETEYrhgPplWI//eHb9fja7v7WKyCF68+TWmgcQLQiLbJsQOg==","shasum":"8e10e7e6ea055130de70465b38d5561c8764fb62","tarball":"https://registry.npmjs.org/@afterauth/sdk/-/sdk-0.1.2.tgz","fileCount":6,"unpackedSize":15122,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCg6FwU9Ro7B4JKLVZ/Rnqctb+EGbgldpbmjFVcQd521AIgRObJwTVXs56hIQxtKyTpC/KyhgOT3kP7aFTDzZEdG4k="}]},"_npmUser":{"name":"afterauth","email":"afterauth@gmail.com"},"directories":{},"maintainers":[{"name":"afterauth","email":"afterauth@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sdk_0.1.2_1780010398659_0.7021214959891131"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-30T05:20:13.742Z","modified":"2026-05-28T23:19:58.932Z","0.0.2":"2026-04-30T05:20:13.990Z","0.0.3":"2026-05-02T17:30:37.045Z","0.1.0":"2026-05-03T16:34:47.355Z","0.1.1":"2026-05-10T00:16:30.981Z","0.1.2":"2026-05-28T23:19:58.830Z"},"maintainers":[{"name":"afterauth","email":"afterauth@gmail.com"}],"readme":"# @afterauth/sdk\n\nPost-auth controls for costly AI, API, and trial usage.\n\nAfterAuth lets you keep signup open while deciding what each user gets next: allow, limit, delay, verify, or deny protected product actions.\n\n## Install\n\n```bash\nnpm install @afterauth/sdk\n```\n\n## Quick Start\n\nCreate a client with a workspace API key, then evaluate a protected action before running the costly product work.\n\n```ts\nimport { AfterAuthClient } from \"@afterauth/sdk\";\n\nconst afterauth = new AfterAuthClient({\n  apiKey: process.env.AFTERAUTH_API_KEY!,\n});\n\nconst decision = await afterauth.evaluateAction({\n  action: \"ai_generation\",\n  userId: \"user_123\",\n  requestedAmount: 1,\n  signals: {\n    email: \"founder@example.com\",\n    emailVerified: true,\n    accountAgeDays: 3,\n    hasPaymentMethod: false,\n  },\n  metadata: {\n    surface: \"studio\",\n  },\n});\n\nif (decision.outcome === \"deny\") {\n  throw new Error(\"Action denied by AfterAuth\");\n}\n\nif (decision.outcome === \"require_verification\") {\n  // Ask the user for the verification step your product already supports.\n}\n\n// Run the protected product action, respecting decision.approvedAmount\n// and decision.allowedCapabilities when your policy returns limits.\n```\n\n## Report Completions\n\nAfter the protected action completes, report the event so future decisions can use the user's activity history.\n\n```ts\nawait afterauth.reportCompletion({\n  action: \"ai_generation\",\n  userId: \"user_123\",\n  decisionId: decision.id,\n  requestId: decision.requestId,\n  metadata: {\n    unitsUsed: 1,\n  },\n});\n```\n\n## Why AfterAuth\n\n- Keep signup open without giving every new account an open tab.\n- Protect expensive product moments after login.\n- Return explicit decisions for protected actions.\n- Keep receipts for every decision.\n\n## Links\n\n- Website: https://afterauth.com\n- Core engine: https://www.npmjs.com/package/@afterauth/core\n","readmeFilename":"README.md","description":"Post-auth controls for costly AI, API, and trial usage","homepage":"https://afterauth.com"}