{"_id":"@aymenkits/auth-otp","name":"@aymenkits/auth-otp","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@aymenkits/auth-otp","version":"1.0.0","description":"One-time-code engine: generate → hash → deliver → verify, with TTL, attempt caps, resend cooldown and a dev master code. Storage and delivery are seams (OtpStore / OtpSender).","license":"MIT","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"build":"tsc -p tsconfig.json","typecheck":"tsc -p tsconfig.json --noEmit"},"dependencies":{"bcryptjs":"^3.0.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/aymenmokhtarikouki/auth-kit.git","directory":"packages/otp"},"keywords":["auth","otp","jwt","authentication","passwordless","oauth","otp"],"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-otp@1.0.0","gitHead":"b2260f281f2deb9854f2b19d781d4c0cc901492a","_nodeVersion":"22.14.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-VmIUAcAKdyhQ6r3HEEHGJRTUXsofYcXL+PAsBA1jba1nTY75TwRZRWHVYj2I8V9Qx0EO2KvHVav4hL865yw0LQ==","shasum":"48b12dea6ed430c1246ec85c475ca45bb1afaac7","tarball":"https://registry.npmjs.org/@aymenkits/auth-otp/-/auth-otp-1.0.0.tgz","fileCount":23,"unpackedSize":33318,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDP28G37cs/uWBxCFiuyL231D4O6NbCo7+4YU0BnLCagQIhAOLUv1p5M/S4B8U8j812ULkw4lZBTHi8oYmoe890XFhQ"}]},"_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-otp_1.0.0_1783791513319_0.2977696557777918"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-11T17:38:33.136Z","1.0.0":"2026-07-11T17:38:33.456Z","modified":"2026-07-11T17:38:33.723Z"},"maintainers":[{"name":"aymen-mokhtari","email":"ayman.mokhtari@proton.me"}],"description":"One-time-code engine: generate → hash → deliver → verify, with TTL, attempt caps, resend cooldown and a dev master code. Storage and delivery are seams (OtpStore / OtpSender).","homepage":"https://github.com/aymenmokhtarikouki/auth-kit#readme","keywords":["auth","otp","jwt","authentication","passwordless","oauth","otp"],"repository":{"type":"git","url":"git+https://github.com/aymenmokhtarikouki/auth-kit.git","directory":"packages/otp"},"author":{"name":"Aymen Mokhtari"},"bugs":{"url":"https://github.com/aymenmokhtarikouki/auth-kit/issues"},"license":"MIT","readme":"# @aymenkits/auth-otp\n\nOTP engine: generate → bcrypt-hash → store → verify/consume, with TTL, attempt caps, resend cooldown and a dev master-code mode. Channel-agnostic (EMAIL / PHONE).\n\n## Install\n\n```bash\nnpm install @aymenkits/auth-otp\n```\n\nInstalls with it: `bcryptjs` (automatic dependency).\n\n## You provide\n\n- `OtpStore` — one table on YOUR schema (create / findLatest / incrementAttempts / consume)\n- `OtpSender` — how codes go out; structural adapters for your existing Twilio client / SMTP transporter are included, the clients are yours\n\nThe package never owns tables, never imports an ORM, HTTP framework, or\nprovider SDK it can take as a parameter — storage and delivery are seams your\napp implements on its own stack.\n\n## Quick example\n\n```ts\nimport { createOtpService, channelRouter } from '@aymenkits/auth-otp'\n\nconst otp = createOtpService({ store, sender: channelRouter({ PHONE: sms, EMAIL: mail }) })\nawait otp.request('PHONE', '+4915112345678')\nawait otp.verify('PHONE', '+4915112345678', '123456')\n```\n\n## Pairs with\n\n- `@aymenkits/auth-core` consumes it for OTP login/registration\n- usable standalone (contact-change verification, step-up auth)\n\nKits pair **by shape, never by import** — pass the sibling kit, your own\nservice, or a stub in tests.\n\n## Docs\n\nFull contracts and integration guides live in the repo:\nhttps://github.com/aymenmokhtarikouki/auth-kit (`contracts/`, `docs/`).\n\n## License\n\nMIT\n","readmeFilename":"README.md","_rev":"1-f32e42af84d698767d006a46f122f84a"}