11{{ #if (eq orm " prisma" )}}
2- import { betterAuth } from "better-auth";
2+ import { betterAuth, type BetterAuthOptions } from "better-auth";
33import { prismaAdapter } from "better-auth/adapters/prisma";
44{{ #if (eq payments " polar" )}}
55import { polar, checkout, portal } from "@polar-sh/better-auth";
66import { polarClient } from "./lib/payments";
77{{ /if }}
88import prisma from "@{{ projectName }} /db";
99
10- export const auth = betterAuth({
10+ export const auth = betterAuth< BetterAuthOptions > ({
1111 database: prismaAdapter(prisma, {
12- {{ #if (eq database " postgres" )}} provider: "postgresql"{{ /if }}
13- {{ #if (eq database " sqlite" )}} provider: "sqlite"{{ /if }}
14- {{ #if (eq database " mysql" )}} provider: "mysql"{{ /if }}
15- {{ #if (eq database " mongodb" )}} provider: "mongodb"{{ /if }}
12+ {{ #if (eq database " postgres" )}} provider: "postgresql", {{ /if }}
13+ {{ #if (eq database " sqlite" )}} provider: "sqlite", {{ /if }}
14+ {{ #if (eq database " mysql" )}} provider: "mysql", {{ /if }}
15+ {{ #if (eq database " mongodb" )}} provider: "mongodb", {{ /if }}
1616 }),
1717 trustedOrigins: [
1818 process.env.CORS_ORIGIN || "",
@@ -59,7 +59,7 @@ export const auth = betterAuth({
5959
6060{{ #if (eq orm " drizzle" )}}
6161{{ #if (or (eq runtime " bun" ) (eq runtime " node" ) (eq runtime " none" ))}}
62- import { betterAuth } from "better-auth";
62+ import { betterAuth, type BetterAuthOptions } from "better-auth";
6363import { drizzleAdapter } from "better-auth/adapters/drizzle";
6464{{ #if (eq payments " polar" )}}
6565import { polar, checkout, portal } from "@polar-sh/better-auth";
@@ -68,7 +68,7 @@ import { polarClient } from "./lib/payments";
6868import { db } from "@{{ projectName }} /db";
6969import * as schema from "@{{ projectName }} /db/schema/auth";
7070
71- export const auth = betterAuth({
71+ export const auth = betterAuth< BetterAuthOptions > ({
7272 database: drizzleAdapter(db, {
7373 {{ #if (eq database " postgres" )}} provider: "pg",{{ /if }}
7474 {{ #if (eq database " sqlite" )}} provider: "sqlite",{{ /if }}
@@ -119,7 +119,7 @@ export const auth = betterAuth({
119119{{ /if }}
120120
121121{{ #if (eq runtime " workers" )}}
122- import { betterAuth } from "better-auth";
122+ import { betterAuth, type BetterAuthOptions } from "better-auth";
123123import { drizzleAdapter } from "better-auth/adapters/drizzle";
124124{{ #if (eq payments " polar" )}}
125125import { polar, checkout, portal } from "@polar-sh/better-auth";
@@ -129,7 +129,7 @@ import { db } from "@{{projectName}}/db";
129129import * as schema from "@{{ projectName }} /db/schema/auth";
130130import { env } from "cloudflare:workers";
131131
132- export const auth = betterAuth({
132+ export const auth = betterAuth< BetterAuthOptions > ({
133133 database: drizzleAdapter(db, {
134134 {{ #if (eq database " postgres" )}} provider: "pg",{{ /if }}
135135 {{ #if (eq database " sqlite" )}} provider: "sqlite",{{ /if }}
@@ -190,19 +190,19 @@ export const auth = betterAuth({
190190 ],
191191 {{ /if }}
192192});
193- {{ /if }}
193+ {{ /if }}
194194{{ /if }}
195195
196196{{ #if (eq orm " mongoose" )}}
197- import { betterAuth } from "better-auth";
197+ import { betterAuth, type BetterAuthOptions } from "better-auth";
198198import { mongodbAdapter } from "better-auth/adapters/mongodb";
199199{{ #if (eq payments " polar" )}}
200200import { polar, checkout, portal } from "@polar-sh/better-auth";
201201import { polarClient } from "./lib/payments";
202202{{ /if }}
203203import { client } from "@{{ projectName }} /db";
204204
205- export const auth = betterAuth({
205+ export const auth = betterAuth< BetterAuthOptions > ({
206206 database: mongodbAdapter(client),
207207 trustedOrigins: [
208208 process.env.CORS_ORIGIN || "",
@@ -248,13 +248,13 @@ export const auth = betterAuth({
248248{{ /if }}
249249
250250{{ #if (eq orm " none" )}}
251- import { betterAuth } from "better-auth";
251+ import { betterAuth, type BetterAuthOptions } from "better-auth";
252252{{ #if (eq payments " polar" )}}
253253import { polar, checkout, portal } from "@polar-sh/better-auth";
254254import { polarClient } from "./lib/payments";
255255{{ /if }}
256256
257- export const auth = betterAuth({
257+ export const auth = betterAuth< BetterAuthOptions > ({
258258 database: "", // Invalid configuration
259259 trustedOrigins: [
260260 process.env.CORS_ORIGIN || "",
0 commit comments