DarkZelus
DarkZelus
BABetter Auth
Created by DarkZelus on 4/16/2025 in #help
Invitation email
I probably missed something but in the doc, I don't understand how the invitation email is actually sent. We can read this:
await authClient.organization.inviteMember({
role: "admin", //this can also be an array for multiple roles (e.g. ["admin", "sale"])
})
await authClient.organization.inviteMember({
role: "admin", //this can also be an array for multiple roles (e.g. ["admin", "sale"])
})
No email is sent as obviously, better-auth doesn't know how to send an email.
My stack: - Sveltekit - Drizzle + Zod - Better-auth Here is my config
{
baseURL: "http://localhost:5173",
secret: AUTH_SECRET || "your-secret-key-at-least-32-characters",
database: drizzleAdapter(db, {
provider: "pg",
schema: schema,
}),
user: {
additionalFields: {
firstName: {
type: "string",
required: true,
input: true
},
lastName: {
type: "string",
required: true,
input: true
},
role: {
type: "string",
required: true,
input: false
}
}
},
emailAndPassword: {
enabled: true,
fromEmail: "[email protected]"
},
socialProviders: {
google: {
clientId: GOOGLE_CLIENT_ID,
clientSecret: GOOGLE_CLIENT_SECRET,
},
},
plugins: [
organization(),
admin()
],

debug: process.env.NODE_ENV !== 'production',
}
{
baseURL: "http://localhost:5173",
secret: AUTH_SECRET || "your-secret-key-at-least-32-characters",
database: drizzleAdapter(db, {
provider: "pg",
schema: schema,
}),
user: {
additionalFields: {
firstName: {
type: "string",
required: true,
input: true
},
lastName: {
type: "string",
required: true,
input: true
},
role: {
type: "string",
required: true,
input: false
}
}
},
emailAndPassword: {
enabled: true,
fromEmail: "[email protected]"
},
socialProviders: {
google: {
clientId: GOOGLE_CLIENT_ID,
clientSecret: GOOGLE_CLIENT_SECRET,
},
},
plugins: [
organization(),
admin()
],

debug: process.env.NODE_ENV !== 'production',
}
Can anyone point me in the right direction?
6 replies