/** * Custom Auth Adapter Factory * * Provides a minimal-config way for users with existing auth systems * to plug into Rebase. Only `verifyRequest` is required — everything * else is optional. * * @example * ```ts * import { createCustomAuthAdapter } from "@rebasepro/server-core"; * * const auth = createCustomAuthAdapter({ * verifyRequest: async (request) => { * const token = request.headers.get("Authorization")?.replace("Bearer ", ""); * if (!token) return null; * const decoded = jwt.verify(token, MY_SECRET); * return { * uid: decoded.sub, * email: decoded.email, * displayName: decoded.name, * roles: decoded.roles || [], * isAdmin: decoded.roles?.includes("admin") ?? false, * }; * }, * }); * ``` */ import type { AuthAdapter, CustomAuthAdapterOptions } from "@rebasepro/types"; /** * Create a custom auth adapter from minimal options. * * This is the recommended entry point for users who already have their own * auth system and just need to tell Rebase how to extract the user from * incoming requests. * * @param options - Configuration options. Only `verifyRequest` is required. * @returns A fully-formed `AuthAdapter` ready for `initializeRebaseBackend()`. */ export declare function createCustomAuthAdapter(options: CustomAuthAdapterOptions): AuthAdapter;