UNPKG

better-auth

Version:

The most comprehensive authentication framework for TypeScript.

38 lines (37 loc) 1.27 kB
import { BetterAuthOptions } from "@better-auth/core"; import { DBAdapter, DBAdapterDebugLogOption } from "@better-auth/core/db/adapter"; import { Db, MongoClient } from "mongodb"; //#region src/adapters/mongodb-adapter/mongodb-adapter.d.ts interface MongoDBAdapterConfig { /** * MongoDB client instance * If not provided, Database transactions won't be enabled. */ client?: MongoClient | undefined; /** * Enable debug logs for the adapter * * @default false */ debugLogs?: DBAdapterDebugLogOption | undefined; /** * Use plural table names * * @default false */ usePlural?: boolean | undefined; /** * Whether to execute multiple operations in a transaction. * * ⚠️ Important: * - Defaults to `true` when a MongoDB client is provided. * - If your MongoDB instance does not support transactions * (e.g. standalone server without a replica set), * you must explicitly set `transaction: false`. */ transaction?: boolean | undefined; } declare const mongodbAdapter: (db: Db, config?: MongoDBAdapterConfig | undefined) => (options: BetterAuthOptions) => DBAdapter<BetterAuthOptions>; //#endregion export { MongoDBAdapterConfig, mongodbAdapter }; //# sourceMappingURL=mongodb-adapter.d.mts.map