supersendtx-better-auth
v0.15.3
Published
SuperSend TX email helpers for Better Auth (verify, reset, magic link, email OTP, invites)
Maintainers
Readme
supersendtx-better-auth
Transactional email for Better Auth — verification, password reset, magic link, email OTP, and organization invites — delivered on SuperSend TX.
Better Auth does not ship an email provider plugin. You supply callbacks. This package is those callbacks, wired to SuperSend TX.
Install
npm install supersendtx-better-auth supersendtx better-authSUPERSENDTX_API_KEY=stx_your_key_hereUsage
import { betterAuth } from 'better-auth'
import { magicLink, emailOTP, organization } from 'better-auth/plugins'
import { createBetterAuthEmail } from 'supersendtx-better-auth'
const email = createBetterAuthEmail({
from: '[email protected]',
apiKey: process.env.SUPERSENDTX_API_KEY!,
appUrl: process.env.BETTER_AUTH_URL,
})
export const auth = betterAuth({
emailVerification: {
sendVerificationEmail: email.sendVerificationEmail,
},
emailAndPassword: {
enabled: true,
sendResetPassword: email.sendResetPassword,
},
plugins: [
magicLink({ sendMagicLink: email.sendMagicLink }),
emailOTP({ sendVerificationOTP: email.sendVerificationOTP }),
organization({ sendInvitationEmail: email.sendInvitationEmail }),
],
})Docs
https://docs.supersendtx.com/guides/better-auth
License
MIT
