import { stripe } from '@better-auth/stripe'
import { betterAuth } from 'better-auth'
import { drizzleAdapter, type DB } from 'better-auth/adapters/drizzle'
import { openAPI, organization } from 'better-auth/plugins'
import Stripe from 'stripe'
export const auth = betterAuth({
database: drizzleAdapter({} as DB, {
provider: 'sqlite',
usePlural: true,
}),
emailAndPassword: {
enabled: true,
},
user: {
additionalFields: {
role: {
type: 'string',
required: false,
defaultValue: 'user',
input: false,
},
},
},
plugins: [
openAPI(),
organization({
// --- Core Organization Settings ---
creatorRole: 'owner',
teams: {
enabled: true,
},
}),
stripe({
stripeClient: new Stripe(
'KEY',
{
apiVersion: '2025-05-28.basil',
},
),
stripeWebhookSecret: 'KEY',
createCustomerOnSignUp: true,
}),
],
})
import { stripe } from '@better-auth/stripe'
import { betterAuth } from 'better-auth'
import { drizzleAdapter, type DB } from 'better-auth/adapters/drizzle'
import { openAPI, organization } from 'better-auth/plugins'
import Stripe from 'stripe'
export const auth = betterAuth({
database: drizzleAdapter({} as DB, {
provider: 'sqlite',
usePlural: true,
}),
emailAndPassword: {
enabled: true,
},
user: {
additionalFields: {
role: {
type: 'string',
required: false,
defaultValue: 'user',
input: false,
},
},
},
plugins: [
openAPI(),
organization({
// --- Core Organization Settings ---
creatorRole: 'owner',
teams: {
enabled: true,
},
}),
stripe({
stripeClient: new Stripe(
'KEY',
{
apiVersion: '2025-05-28.basil',
},
),
stripeWebhookSecret: 'KEY',
createCustomerOnSignUp: true,
}),
],
})