Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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-auth
SUPERSENDTX_API_KEY=stx_your_key_here

Usage

import { betterAuth } from 'better-auth'
import { magicLink, emailOTP, organization } from 'better-auth/plugins'
import { createBetterAuthEmail } from 'supersendtx-better-auth'

const email = createBetterAuthEmail({
  from: 'noreply@yourdomain.com',
  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

About

Transactional email for Better Auth via SuperSend TX (verify, reset, magic link, OTP, invites)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages