Notix
Integrations

Better Auth's emails, sent by Notix.

Better Auth does not send email itself: it calls functions you provide when a user needs a verification link or a password reset. Each of those functions is a notix-js send, so every authentication email goes through your verified domain.

The send

Send an email from Better Auth.

lib/auth.ts
import { betterAuth } from "better-auth";
import { Notix } from "notix-js";

const notix = new Notix(process.env.NOTIX_API_KEY!);
const from = "Acme <accounts@acme.com>";

export const auth = betterAuth({
  emailAndPassword: {
    enabled: true,
    sendResetPassword: async ({ user, url }) => {
      await notix.emails.send({ from, to: user.email, subject: "Reset your password", html: `<a href="${url}">Reset your password</a>` });
    },
  },
  emailVerification: {
    sendVerificationEmail: async ({ user, url }) => {
      await notix.emails.send({ from, to: user.email, subject: "Confirm your email", html: `<a href="${url}">Confirm your email</a>` });
    },
  },
});

The from address must be on a domain you have verified in Notix. Step by step: the Node.js quickstart and the longer guide to sending email from Node.js.

Environment

One API key, kept on the server.

Create an API key on the API keys page of the Notix console and store it as NOTIX_API_KEY in the server environment, beside BETTER_AUTH_SECRET. Read it only in code that runs on the server, never in anything shipped to a browser.

A Send only key is enough for code that only sends: if it leaks, it cannot read your contacts or delete a domain.

.env
NOTIX_API_KEY=notix_xxxxxxxxxxxx
NOTIX_WEBHOOK_SECRET=whsec_xxxxxxxxxxxx
FAQ

Questions, answered.

Where does Better Auth send its emails from?
From the callbacks you configure. Better Auth passes the user and the link; the callback decides how the email is sent, here with notix-js.
Should a failed send stop the sign-up?
Check the error notix-js returns and log it. Whether to fail the request is your choice; the user can ask for another link, which calls the callback again.
Why is my send refused with a from-address error?
The from address must be on a domain you have verified in Notix. Add the domain in the console, publish the DNS records it shows, and wait for verification; until then, sends from that domain are refused.

The free plan does not ask for a card.

Send your first email in five minutes.

Verify a domain, copy an API key, make one call. The free plan does not ask for a card.