UNPKG

better-auth

Version:

The most comprehensive authentication framework for TypeScript.

1 lines 1.1 kB
{"version":3,"file":"auth.mjs","names":[],"sources":["../../src/auth/auth.ts"],"sourcesContent":["import type { BetterAuthOptions } from \"@better-auth/core\";\nimport { init } from \"../context/init\";\nimport type { Auth } from \"../types\";\nimport { createBetterAuth } from \"./base\";\n\n/**\n * Better Auth initializer for full mode (with Kysely)\n *\n * @example\n * ```ts\n * import { betterAuth } from \"better-auth\";\n *\n * const auth = betterAuth({\n * \tdatabase: new PostgresDialect({ connection: process.env.DATABASE_URL }),\n * });\n * ```\n *\n * For minimal mode (without Kysely), import from `better-auth/minimal` instead\n * @example\n * ```ts\n * import { betterAuth } from \"better-auth/minimal\";\n *\n * const auth = betterAuth({\n *\t database: drizzleAdapter(db, { provider: \"pg\" }),\n * });\n */\nexport const betterAuth = <Options extends BetterAuthOptions>(\n\toptions: Options & Record<never, never>,\n): Auth<Options> => {\n\treturn createBetterAuth(options, init);\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,MAAa,cACZ,YACmB;AACnB,QAAO,iBAAiB,SAAS,KAAK"}