{"_id":"@aymenkits/auth-core","_rev":"2-f9ae31ac0e8782b52d9ece2b788cc252","name":"@aymenkits/auth-core","dist-tags":{"latest":"1.1.0"},"versions":{"1.0.0":{"name":"@aymenkits/auth-core","version":"1.0.0","keywords":["auth","otp","jwt","authentication","passwordless","oauth","core"],"author":{"name":"Aymen Mokhtari"},"license":"MIT","_id":"@aymenkits/auth-core@1.0.0","maintainers":[{"name":"aymen-mokhtari","email":"ayman.mokhtari@proton.me"}],"homepage":"https://github.com/aymenmokhtarikouki/auth-kit#readme","bugs":{"url":"https://github.com/aymenmokhtarikouki/auth-kit/issues"},"dist":{"shasum":"d105d016898af6964a7ee357b0588b47c0244e47","tarball":"https://registry.npmjs.org/@aymenkits/auth-core/-/auth-core-1.0.0.tgz","fileCount":27,"integrity":"sha512-FvlHMKf4D2TEasnN6ZgzZJw7XqUhESaCTeeVKDrvj9i8F+qGhXg3IrcCMbEgTBTBjKIOjoXXLchiexSddIhhDw==","signatures":[{"sig":"MEUCIQCwV9M/dLnjkxjb4XG0jYX/VAGppfegdJ4sGF6II3mNWwIgXOEODRK/qPUS6clTK2a+sjOsvFoZ3t4J+mh23z1Tlz8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":62349},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=18"},"gitHead":"b2260f281f2deb9854f2b19d781d4c0cc901492a","scripts":{"build":"tsc -p tsconfig.json","typecheck":"tsc -p tsconfig.json --noEmit"},"_npmUser":{"name":"aymen-mokhtari","email":"ayman.mokhtari@proton.me"},"repository":{"url":"git+https://github.com/aymenmokhtarikouki/auth-kit.git","type":"git","directory":"packages/core"},"_npmVersion":"10.9.2","description":"OTP-first identity & sessions: email/phone code login (find-or-create), Google & Apple ID-token sign-in with account linking, JWT access tokens, pluggable refresh strategies (rotating multi-device / static single-token), OTP-verified contact change. Stora","directories":{},"sideEffects":false,"_nodeVersion":"22.14.0","dependencies":{"jose":"^5.9.6","bcryptjs":"^3.0.2","jsonwebtoken":"^9.0.2","@aymenkits/auth-otp":"1.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@types/jsonwebtoken":"^9.0.7"},"_npmOperationalInternal":{"tmp":"tmp/auth-core_1.0.0_1783791510220_0.47641753584523094","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@aymenkits/auth-core","version":"1.1.0","description":"OTP-first identity & sessions: email/phone code login (find-or-create), Google & Apple ID-token sign-in with account linking, JWT access tokens, pluggable refresh strategies (rotating multi-device / static single-token), OTP-verified contact change. Stora","license":"MIT","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"build":"tsc -p tsconfig.json","typecheck":"tsc -p tsconfig.json --noEmit","prepublishOnly":"npm run build"},"dependencies":{"@aymenkits/auth-otp":"1.0.0","auth-kit":"file:../..","bcryptjs":"^3.0.2","jose":"^5.9.6","jsonwebtoken":"^9.0.2"},"devDependencies":{"@types/jsonwebtoken":"^9.0.7"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/aymenmokhtarikouki/auth-kit.git","directory":"packages/core"},"keywords":["auth","otp","jwt","authentication","passwordless","oauth","core"],"engines":{"node":">=18"},"sideEffects":false,"homepage":"https://github.com/aymenmokhtarikouki/auth-kit#readme","bugs":{"url":"https://github.com/aymenmokhtarikouki/auth-kit/issues"},"author":{"name":"Aymen Mokhtari"},"_id":"@aymenkits/auth-core@1.1.0","_nodeVersion":"22.14.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-d3Qpp2kH1FHfHRdgyt4ET402dBs0YbrQnYB7gTVEDDDPCirTmpXJ4ZPAkSa02ZnzJ6lhGP/yHF02rLo8x/oreg==","shasum":"5e96318eea7dda466231e50cea19abf1fc6826b9","tarball":"https://registry.npmjs.org/@aymenkits/auth-core/-/auth-core-1.1.0.tgz","fileCount":27,"unpackedSize":76167,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIAbVg/cjZFkTcneHNB7o45Pr6jfkw0nKfQdYuuSCT8hBAiAo8MWol+jaEWI0sJnkQD4/oaq0FO7ABYe2zerSU0T7Pg=="}]},"_npmUser":{"name":"aymen-mokhtari","email":"ayman.mokhtari@proton.me"},"directories":{},"maintainers":[{"name":"aymen-mokhtari","email":"ayman.mokhtari@proton.me"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/auth-core_1.1.0_1787827170652_0.5880430117373339"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-11T17:38:30.069Z","modified":"2026-08-27T10:39:30.958Z","1.0.0":"2026-07-11T17:38:30.365Z","1.1.0":"2026-08-27T10:39:30.772Z"},"bugs":{"url":"https://github.com/aymenmokhtarikouki/auth-kit/issues"},"author":{"name":"Aymen Mokhtari"},"license":"MIT","homepage":"https://github.com/aymenmokhtarikouki/auth-kit#readme","keywords":["auth","otp","jwt","authentication","passwordless","oauth","core"],"repository":{"type":"git","url":"git+https://github.com/aymenmokhtarikouki/auth-kit.git","directory":"packages/core"},"description":"OTP-first identity & sessions: email/phone code login (find-or-create), Google & Apple ID-token sign-in with account linking, JWT access tokens, pluggable refresh strategies (rotating multi-device / static single-token), OTP-verified contact change. Stora","maintainers":[{"name":"aymen-mokhtari","email":"ayman.mokhtari@proton.me"}],"readme":"# @aymenkits/auth-core\r\n\r\nOTP-first identity: token service (JWT HS256, drop-in compatible with hand-rolled jsonwebtoken apps), rotating OR static refresh strategies (rotating takes an `onReplay` scope), password login (optional), Google/Apple ID-token sign-in, GitHub access-token sign-in, find-or-create flows and OTP-verified contact change.\r\n\r\n## Install\r\n\r\n```bash\r\nnpm install @aymenkits/auth-core\r\n```\r\n\r\nInstalls with it: `@aymenkits/auth-otp`, `bcryptjs`, `jsonwebtoken`, `jose` (automatic dependencies).\r\n\r\n## You provide\r\n\r\n- `UserStore` — find/create users on YOUR schema (profile shape is yours)\r\n- `SessionStore` — refresh-token persistence (a table or a single column, per strategy)\r\n- Your JWT secrets — keeping them means existing tokens stay valid\r\n\r\nThe package never owns tables, never imports an ORM, HTTP framework, or\r\nprovider SDK it can take as a parameter — storage and delivery are seams your\r\napp implements on its own stack.\r\n\r\n## Quick example\r\n\r\n```ts\r\nimport { createTokenService, createAuthFlows } from '@aymenkits/auth-core'\r\n\r\nconst tokens = createTokenService({ accessSecret, refreshSecret })\r\nconst auth = createAuthFlows({ users, sessions, tokens, otp, strategy: 'rotating' })\r\nconst session = await auth.verifyOtp({ channel: 'PHONE', destination, code })\r\n```\r\n\r\n## Pairs with\r\n\r\n- `@aymenkits/auth-express` for routes/middleware\r\n- `@aymenkits/chat-socketio` accepts the TokenService as its handshake `identity`\r\n\r\nKits pair **by shape, never by import** — pass the sibling kit, your own\r\nservice, or a stub in tests.\r\n\r\n## Docs\r\n\r\nFull contracts and integration guides live in the repo:\r\nhttps://github.com/aymenmokhtarikouki/auth-kit (`contracts/`, `docs/`).\r\n\r\n## License\r\n\r\nMIT\r\n","readmeFilename":"README.md"}