// use this in kysely and better-auth
export const pool = new Pool({
connectionString: process.env.DATABASE_URL,
});
export const db = new Kysely<Database>({
dialect: PostgresDialect({
pool,
}),
});
export const auth = betterAuth({
secret: process.env.BETTER_AUTH_SECRET!,
database: pool,
emailAndPassword: {
enabled: true,
},
// nextcookies must be the last plugin in the array
plugins: [nextCookies()],
});
// use this in kysely and better-auth
export const pool = new Pool({
connectionString: process.env.DATABASE_URL,
});
export const db = new Kysely<Database>({
dialect: PostgresDialect({
pool,
}),
});
export const auth = betterAuth({
secret: process.env.BETTER_AUTH_SECRET!,
database: pool,
emailAndPassword: {
enabled: true,
},
// nextcookies must be the last plugin in the array
plugins: [nextCookies()],
});