UNPKG

shiro-better-auth

Version:

A Better Auth adapter for RONIN

39 lines (36 loc) 953 B
import { AdapterInstance } from 'better-auth/types'; import { createSyntaxFactory } from 'shiro-orm'; type SyntaxFactory = ReturnType<typeof createSyntaxFactory>; /** * Create a new Better Auth adapter to communicate with RONIN. * * @param [client] - A RONIN syntax factory instance. * * @returns A Better Auth adapter to communicate with RONIN * * @example * ```ts * import { ronin } from 'shiro-better-auth'; * import { betterAuth } from 'better-auth'; * * const auth = betterAuth({ * database: ronin() * }); * ``` * * @example * ```ts * import { ronin } from 'shiro-better-auth'; * import { createSyntaxFactory } from 'shiro-orm'; * import { betterAuth } from 'better-auth'; * * const client = createSyntaxFactory({ * token: '1234' * }); * const auth = betterAuth({ * database: ronin(client) * }); * ``` */ declare const ronin: (client?: SyntaxFactory) => AdapterInstance; export { ronin as default, ronin };