{"_id":"@dman926/better-auth-conjoined-email","_rev":"5-a6c02989c372f86acf8a40f2906052fb","name":"@dman926/better-auth-conjoined-email","dist-tags":{"latest":"1.0.4"},"versions":{"1.0.0":{"name":"@dman926/better-auth-conjoined-email","version":"1.0.0","author":{"name":"Dennis James Stelmach","email":"dj@dstelmach.com"},"license":"MIT","_id":"@dman926/better-auth-conjoined-email@1.0.0","maintainers":[{"name":"dman926","email":"dj@dstelmach.com"}],"homepage":"https://github.com/dman926/better-auth-conjoined-email#readme","bugs":{"url":"https://github.com/dman926/better-auth-conjoined-email/issues"},"dist":{"shasum":"56121b0d07e8dbb91d18628770f4a767416c7a7c","tarball":"https://registry.npmjs.org/@dman926/better-auth-conjoined-email/-/better-auth-conjoined-email-1.0.0.tgz","fileCount":11,"integrity":"sha512-fyQkxLdPfSJhfxB4qVZcNoEKiv6GEMIDkIyjzJU2GI8a2GNY2QFPXODM3WawQ7MVATcBrk6bI22IkDe7XIVQIw==","signatures":[{"sig":"MEUCIDjfDq0Xkp0WOOpJ2llrhudkZ2mFzqQkKOv6oBqWA6UhAiEApCd5OOqsXa3qmi8NFZB26hCw4GAMkL66z4uBjV3RiDI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":41515},"type":"module","_from":"file:dman926-better-auth-conjoined-email-1.0.0.tgz","exports":{".":{"types":"./src/index.d.ts","default":"./src/index.js","dev-source":"./src/index.js"},"./client":{"types":"./src/index.client.d.ts","default":"./src/index.client.js","dev-source":"./src/index.client.js"}},"scripts":{"lint":"eslint","test":"vitest","build":"tsc","clean":"rm ./src/*.d.ts ./src/*.d.ts.map","test:e2e":"playwright test"},"_npmUser":{"name":"dman926","email":"dj@dstelmach.com"},"_resolved":"/tmp/462bde4aa3a77ba16f7f98193794fe74/dman926-better-auth-conjoined-email-1.0.0.tgz","_integrity":"sha512-fyQkxLdPfSJhfxB4qVZcNoEKiv6GEMIDkIyjzJU2GI8a2GNY2QFPXODM3WawQ7MVATcBrk6bI22IkDe7XIVQIw==","repository":{"url":"git+https://github.com/dman926/better-auth-conjoined-email.git","type":"git"},"_npmVersion":"11.7.0","description":"Send a conjoined authentication email using multiple authentication methods at once","directories":{},"_nodeVersion":"24.12.0","dependencies":{"better-auth":"^1.4.9"},"typesVersions":{"*":{"*":["./src/index.d.ts"],"client":["./src/index.client.d.ts"]}},"_hasShrinkwrap":false,"devDependencies":{"jsdom":"^27.4.0","eslint":"^9.39.2","vitest":"^4.0.16","globals":"^16.5.0","@eslint/js":"^9.39.2","typescript":"^5.9.3","@types/node":"^20.19.27","concurrently":"^9.2.1","@playwright/test":"^1.57.0","typescript-eslint":"^8.51.0","@better-fetch/fetch":"^1.1.21"},"peerDependencies":{"better-auth":"^1.4.9"},"_npmOperationalInternal":{"tmp":"tmp/better-auth-conjoined-email_1.0.0_1767285125211_0.4562278482172304","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@dman926/better-auth-conjoined-email","version":"1.0.1","author":{"name":"Dennis James Stelmach","email":"dj@dstelmach.com"},"license":"MIT","_id":"@dman926/better-auth-conjoined-email@1.0.1","maintainers":[{"name":"dman926","email":"dj@dstelmach.com"}],"homepage":"https://github.com/dman926/better-auth-conjoined-email#readme","bugs":{"url":"https://github.com/dman926/better-auth-conjoined-email/issues"},"dist":{"shasum":"997790b290c2856a37503f5ca081f679766f7e4f","tarball":"https://registry.npmjs.org/@dman926/better-auth-conjoined-email/-/better-auth-conjoined-email-1.0.1.tgz","fileCount":12,"integrity":"sha512-0LWZNpTQJGs4eFDEgHGF+C/jx810YlUmG+kRY6BJl+PX6tFdS8qWJoG2h1v/0xlPnZfpNfvjmOgUdNwHgNcvNw==","signatures":[{"sig":"MEUCIDHVy8OdIlWmdmvmmxXF6dRfSomVLQnntoqu5KdSTLmGAiEAz8ANqXhBpKvM8v6qMVH48FPIhDxhbnA/JWaXzim10Vg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@dman926%2fbetter-auth-conjoined-email@1.0.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":42325},"type":"module","_from":"file:dman926-better-auth-conjoined-email-1.0.1.tgz","exports":{".":{"types":"./src/index.d.ts","default":"./src/index.js","dev-source":"./src/index.js"},"./client":{"types":"./src/index.client.d.ts","default":"./src/index.client.js","dev-source":"./src/index.client.js"}},"scripts":{"lint":"eslint","test":"vitest","build":"tsc","clean":"rm ./src/*.d.ts ./src/*.d.ts.map","test:e2e":"playwright test"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:b3df8ea6-de99-4005-aee5-8b984d2284ba"}},"_resolved":"/tmp/b63df136304e3f1837a3eeae0340dd35/dman926-better-auth-conjoined-email-1.0.1.tgz","_integrity":"sha512-0LWZNpTQJGs4eFDEgHGF+C/jx810YlUmG+kRY6BJl+PX6tFdS8qWJoG2h1v/0xlPnZfpNfvjmOgUdNwHgNcvNw==","repository":{"url":"git+https://github.com/dman926/better-auth-conjoined-email.git","type":"git"},"_npmVersion":"11.6.2","description":"Send a conjoined authentication email using multiple authentication methods at once","directories":{},"_nodeVersion":"24.12.0","dependencies":{"better-auth":"^1.4.9"},"typesVersions":{"*":{"*":["./src/index.d.ts"],"client":["./src/index.client.d.ts"]}},"_hasShrinkwrap":false,"devDependencies":{"jsdom":"^27.4.0","eslint":"^9.39.2","vitest":"^4.0.16","globals":"^16.5.0","@eslint/js":"^9.39.2","typescript":"^5.9.3","@types/node":"^20.19.27","concurrently":"^9.2.1","@playwright/test":"^1.57.0","typescript-eslint":"^8.51.0","@better-fetch/fetch":"^1.1.21"},"peerDependencies":{"better-auth":"^1.4.9"},"_npmOperationalInternal":{"tmp":"tmp/better-auth-conjoined-email_1.0.1_1767286576727_0.42700819638824217","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@dman926/better-auth-conjoined-email","version":"1.0.2","author":{"name":"Dennis James Stelmach","email":"dj@dstelmach.com"},"license":"MIT","_id":"@dman926/better-auth-conjoined-email@1.0.2","maintainers":[{"name":"dman926","email":"dj@dstelmach.com"}],"homepage":"https://github.com/dman926/better-auth-conjoined-email#readme","bugs":{"url":"https://github.com/dman926/better-auth-conjoined-email/issues"},"dist":{"shasum":"e20e3db9857bff03995299c224c7be5dc60692fd","tarball":"https://registry.npmjs.org/@dman926/better-auth-conjoined-email/-/better-auth-conjoined-email-1.0.2.tgz","fileCount":9,"integrity":"sha512-lmzRnArTk8PodIt6QBk7bgJcx8uGGWcvihufeHyO5JKJxdMoFM9VpV7NkBmu1y0qM2M3ozgshSC7R1qyZyNZpw==","signatures":[{"sig":"MEYCIQCLaAcwNmdXrCQSSJWM0WDEbO60NTYQenFASun26oCFpQIhANMGVP/0GJ91KYgsIjR+G3qO+xdwOfj02i7CgeOA38bt","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@dman926%2fbetter-auth-conjoined-email@1.0.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":40826},"type":"module","_from":"file:dman926-better-auth-conjoined-email-1.0.2.tgz","exports":{".":{"types":"./src/index.d.ts","default":"./src/index.js","dev-source":"./src/index.js"},"./client":{"types":"./src/index.client.d.ts","default":"./src/index.client.js","dev-source":"./src/index.client.js"}},"scripts":{"lint":"eslint","test":"vitest","build":"tsc","clean":"rm ./src/*.d.ts ./src/*.d.ts.map","test:e2e":"playwright test"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:b3df8ea6-de99-4005-aee5-8b984d2284ba"}},"_resolved":"/tmp/0e69d9a97053075238b036a215c548bb/dman926-better-auth-conjoined-email-1.0.2.tgz","_integrity":"sha512-lmzRnArTk8PodIt6QBk7bgJcx8uGGWcvihufeHyO5JKJxdMoFM9VpV7NkBmu1y0qM2M3ozgshSC7R1qyZyNZpw==","repository":{"url":"git+https://github.com/dman926/better-auth-conjoined-email.git","type":"git"},"_npmVersion":"11.6.2","description":"Send a conjoined authentication email using multiple authentication methods at once","directories":{},"_nodeVersion":"24.12.0","dependencies":{"better-auth":"^1.4.9"},"typesVersions":{"*":{"*":["./src/index.d.ts"],"client":["./src/index.client.d.ts"]}},"_hasShrinkwrap":false,"devDependencies":{"jsdom":"^27.4.0","eslint":"^9.39.2","vitest":"^4.0.16","globals":"^16.5.0","@eslint/js":"^9.39.2","typescript":"^5.9.3","@types/node":"^20.19.27","concurrently":"^9.2.1","@playwright/test":"^1.57.0","typescript-eslint":"^8.51.0","@better-fetch/fetch":"^1.1.21"},"peerDependencies":{"better-auth":"^1.4.9"},"_npmOperationalInternal":{"tmp":"tmp/better-auth-conjoined-email_1.0.2_1767333180443_0.6601332314293431","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@dman926/better-auth-conjoined-email","version":"1.0.3","author":{"name":"Dennis James Stelmach","email":"dj@dstelmach.com"},"license":"MIT","_id":"@dman926/better-auth-conjoined-email@1.0.3","maintainers":[{"name":"dman926","email":"dj@dstelmach.com"}],"homepage":"https://github.com/dman926/better-auth-conjoined-email#readme","bugs":{"url":"https://github.com/dman926/better-auth-conjoined-email/issues"},"dist":{"shasum":"8abd4724fce3981e6222ae22185464df58354e2c","tarball":"https://registry.npmjs.org/@dman926/better-auth-conjoined-email/-/better-auth-conjoined-email-1.0.3.tgz","fileCount":12,"integrity":"sha512-VUQNoDQKr2xA41ofsz9wImzABAv/8LwnbnODEQ5i2Dc5M9PxtPoG9KPxw9tCi44snMhJ45iXL7Z2nYHJInDGAg==","signatures":[{"sig":"MEQCIHx0ndwq2wbzq/JO8tCoeSdPS928diR5k7mLcMl6PQWWAiAFKIeo7n0EgpPmMzgCAUBCgZfGNWTKPZm4Yw4L/S20dQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@dman926%2fbetter-auth-conjoined-email@1.0.3","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":90920},"type":"module","_from":"file:dman926-better-auth-conjoined-email-1.0.3.tgz","exports":{".":{"types":"./src/index.d.ts","default":"./src/index.js","dev-source":"./src/index.js"},"./client":{"types":"./src/index.client.d.ts","default":"./src/index.client.js","dev-source":"./src/index.client.js"}},"scripts":{"lint":"eslint","test":"vitest","build":"rm src/*.d.ts src/*.d.ts.map || true && tsc","clean":"rm ./src/*.d.ts ./src/*.d.ts.map","test:e2e":"playwright test"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:b3df8ea6-de99-4005-aee5-8b984d2284ba"}},"_resolved":"/tmp/58c702bdb904d682c2516cd9fc016c7b/dman926-better-auth-conjoined-email-1.0.3.tgz","_integrity":"sha512-VUQNoDQKr2xA41ofsz9wImzABAv/8LwnbnODEQ5i2Dc5M9PxtPoG9KPxw9tCi44snMhJ45iXL7Z2nYHJInDGAg==","repository":{"url":"git+https://github.com/dman926/better-auth-conjoined-email.git","type":"git"},"_npmVersion":"11.11.0","description":"Send a conjoined authentication email using multiple authentication methods at once","directories":{},"_nodeVersion":"24.14.1","dependencies":{"better-auth":"^1.6.4"},"typesVersions":{"*":{"*":["./src/index.d.ts"],"client":["./src/index.client.d.ts"]}},"_hasShrinkwrap":false,"devDependencies":{"zod":"^4.3.6","jsdom":"^27.4.0","eslint":"^9.39.4","vitest":"^4.1.4","globals":"^16.5.0","@eslint/js":"^9.39.4","typescript":"^5.9.3","@types/node":"^20.19.39","@playwright/test":"^1.59.1","typescript-eslint":"^8.58.2"},"peerDependencies":{"better-auth":"^1.4.9"},"_npmOperationalInternal":{"tmp":"tmp/better-auth-conjoined-email_1.0.3_1776295555931_0.3609170359205267","host":"s3://npm-registry-packages-npm-production"}},"1.0.4":{"name":"@dman926/better-auth-conjoined-email","license":"MIT","version":"1.0.4","author":{"name":"Dennis James Stelmach","email":"dj@dstelmach.com"},"description":"Send a conjoined authentication email using multiple authentication methods at once","repository":{"type":"git","url":"git+https://github.com/dman926/better-auth-conjoined-email.git"},"devDependencies":{"@eslint/js":"^9.39.4","@playwright/test":"^1.59.1","@types/node":"^20.19.39","eslint":"^9.39.4","globals":"^16.5.0","jsdom":"^27.4.0","typescript":"^5.9.3","typescript-eslint":"^8.58.2","vitest":"^4.1.4","zod":"^4.3.6"},"dependencies":{"better-auth":"^1.6.4"},"peerDependencies":{"better-auth":"^1.4.9"},"type":"module","exports":{".":{"dev-source":"./src/index.js","types":"./src/index.d.ts","default":"./src/index.js"},"./client":{"dev-source":"./src/index.client.js","types":"./src/index.client.d.ts","default":"./src/index.client.js"}},"typesVersions":{"*":{"*":["./src/index.d.ts"],"client":["./src/index.client.d.ts"]}},"scripts":{"build":"rm src/*.d.ts src/*.d.ts.map || true && tsc","test":"vitest","test:e2e":"playwright test","lint":"eslint","clean":"rm ./src/*.d.ts ./src/*.d.ts.map"},"_id":"@dman926/better-auth-conjoined-email@1.0.4","bugs":{"url":"https://github.com/dman926/better-auth-conjoined-email/issues"},"homepage":"https://github.com/dman926/better-auth-conjoined-email#readme","_integrity":"sha512-G9jGb8TFUsMQqnv5m1ag7tW0BapXF1q5uGLBU8i4UK1sHF0ZuXpOI2RRWGw6cE3bQMLi6csuetvhW043beGzmQ==","_resolved":"/tmp/ae0510eaa1cfd1b5a859bf8dcc1bb85f/dman926-better-auth-conjoined-email-1.0.4.tgz","_from":"file:dman926-better-auth-conjoined-email-1.0.4.tgz","_nodeVersion":"24.14.1","_npmVersion":"11.11.0","dist":{"integrity":"sha512-G9jGb8TFUsMQqnv5m1ag7tW0BapXF1q5uGLBU8i4UK1sHF0ZuXpOI2RRWGw6cE3bQMLi6csuetvhW043beGzmQ==","shasum":"1685d288ed3314435f29b3a0af54289ea61c0ad4","tarball":"https://registry.npmjs.org/@dman926/better-auth-conjoined-email/-/better-auth-conjoined-email-1.0.4.tgz","fileCount":12,"unpackedSize":90950,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@dman926%2fbetter-auth-conjoined-email@1.0.4","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCICwlH5iL9lYiCw6mJi0vjzMv85ooLh33CWM71MEbDJzrAiBc+tJdqZFSt4WV7IiicWzYmDvJyAh1LaHhSjqQ4zGHMw=="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:b3df8ea6-de99-4005-aee5-8b984d2284ba"}},"directories":{},"maintainers":[{"name":"dman926","email":"dj@dstelmach.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/better-auth-conjoined-email_1.0.4_1776296414904_0.7610416801371305"},"_hasShrinkwrap":false}},"time":{"created":"2026-01-01T16:32:05.151Z","modified":"2026-04-15T23:40:15.315Z","1.0.0":"2026-01-01T16:32:05.345Z","1.0.1":"2026-01-01T16:56:16.890Z","1.0.2":"2026-01-02T05:53:00.578Z","1.0.3":"2026-04-15T23:25:56.084Z","1.0.4":"2026-04-15T23:40:15.052Z"},"bugs":{"url":"https://github.com/dman926/better-auth-conjoined-email/issues"},"author":{"name":"Dennis James Stelmach","email":"dj@dstelmach.com"},"license":"MIT","homepage":"https://github.com/dman926/better-auth-conjoined-email#readme","repository":{"type":"git","url":"git+https://github.com/dman926/better-auth-conjoined-email.git"},"description":"Send a conjoined authentication email using multiple authentication methods at once","maintainers":[{"name":"dman926","email":"dj@dstelmach.com"}],"readme":"# better-auth-conjoined-email\n\n[![Test](https://github.com/dman926/better-auth-conjoined-email/actions/workflows/test.yml/badge.svg)](https://github.com/dman926/better-auth-conjoined-email/actions/workflows/test.yml)\n[![NPM Version](https://img.shields.io/npm/v/%40dman926%2Fbetter-auth-conjoined-email)](https://www.npmjs.com/package/@dman926/better-auth-conjoined-email)\n\nSend a conjoined authentication email using multiple authentication methods at once.\n\n## Why\n\nThere isn't a clean way to have both the better-auth [magicLink](https://www.better-auth.com/docs/plugins/magic-link) and [emailOTP](https://www.better-auth.com/docs/plugins/email-otp) plugins defined in your auth config and have both fire at the same time, sending a single email with both authentication options, so I made this plugin.\n\n## Install\n\n```\nnpm i @dman926/better-auth-conjoined-email\n```\n\n```\nyarn add @dman926/better-auth-conjoined-email\n```\n\n```\npnpm add @dman926/better-auth-conjoined-email\n```\n\n## Usage\n\nAdd to the server better-auth configuration:\n\n```ts\n// src/server/auth.ts\nimport { betterAuth } from \"better-auth\";\nimport { conjoinedEmailPlugin } from \"@dman926/better-auth-conjoined-email\";\n\nexport const auth = betterAuth({\n  // ...\n  plugins: [\n    conjoinedEmailPlugin({\n      sendAuthenticationEmail: ({ email, otp, magicLink, magicLinkToken }) => {\n        // Send the email containing both OTP and magic link\n      },\n    }),\n    // magicLink and emailOTP plugins are contained in conjoinedEmailPlugin\n    // and do not need to be added\n  ],\n});\n```\n\nAnd add to the client better-auth configuration:\n\n```ts\n// src/client/auth.ts\nimport { createAuthClient } from \"better-auth/svelte\";\nimport { conjoinedEmailClient } from \"@dman926/better-auth-conjoined-email/client\";\n\nexport const authClient = createAuthClient({\n  plugins: [\n    conjoinedEmailClient(),\n    // magicLinkClient and emailOTPClient are contained in conjoinedEmailClient\n    // and do not need to be added\n  ],\n});\n```\n\nAnd use it in the app:\n\n```ts\n// src/routes/some-page.tsx\nimport { useCallback, useState } from \"react\"\nimport { authClient } from \"src/client/auth\";\n\nexport function SignIn() {\n  const [email, setEmail] = useState('');\n\n  const handleSignIn = useCallback((ev) => {\n    ev.preventDefault();\n\n    // Send the email containing an OTP code and a magic link\n    authClient.signIn.conjoinedEmail({ email });\n    // auth.api.sendConjoinedEmail is available on the server auth\n  }, [email]);\n\n  return (\n    <input\n      type=\"email\"\n      placeholder=\"Email\"\n      value={email}\n      onInput={(ev) => { setEmail(ev.target.value) }}\n    />\n    <button onClick={handleSignIn}>Sign In</button>\n  );\n}\n```\n\n## Options\n\n| Option                  | Description                                                                                                                                                                         | Default               |\n| :---------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------- |\n| sendAuthenticationEmail | Handler to send the authentication email. `email`, `otp`, `magicLink`, and `magicLinkToken` are provided as the first parameter.                                                    | \\*                    |\n| otpLength               | The length of the OTP code                                                                                                                                                          | 6                     |\n| expiresIn               | The time in seconds the magic link and OTP code are valid for. Can also be provided as an object<br />(`{ magicLink: number; emailOTP: number }`)<br />to describe each expire time | 600<br />(10 minutes) |\n| allowSimultaneousUse    | When `true`, users can authenticate through both methods, where-as normally when one method is used, the other is invalidated                                                       | false                 |\n","readmeFilename":"README.md"}