import { BetterAuthConfig, EmailServiceConfig, OIDCProviderConfig, SAMLProviderConfig, SSOProviderConfig, UserAuthConfig } from "./auth-types.js"; import { extractCookieDomain, hasCredentialAccount } from "./auth-config-utils.js"; import * as jose0 from "jose"; import * as zod0 from "zod"; import * as better_auth0 from "better-auth"; import * as _better_auth_oauth_provider0 from "@better-auth/oauth-provider"; import * as better_auth_plugins0 from "better-auth/plugins"; import * as better_call0 from "better-call"; import * as zod_v4_core0 from "zod/v4/core"; //#region src/auth/auth.d.ts /** * Type-only helper: a simplified betterAuth call that TypeScript can evaluate * cheaply to produce precise API types. The real createAuth() has complex * callbacks/closures that cause TypeScript to fall back to index signatures. * This function is never called at runtime. * * Note: sso() and dash() are intentionally excluded here. They come from * @better-auth/sso and @better-auth/infra which resolve @better-auth/core * through different pnpm virtual store paths (due to @better-auth/infra * bundling better-call@beta). This creates duplicate @better-auth/core * instances that TypeScript treats as incompatible, causing the plugins * array to widen to BetterAuthPlugin[] and producing an index signature * on .api. Since no auth.api.* calls use SSO or dash methods, omitting * them is safe and preserves precise types. */ declare function _inferAuthType(): better_auth0.Auth<{ plugins: [{ id: "bearer"; version: string; hooks: { before: { matcher(context: better_auth0.HookEndpointContext): boolean; handler: better_call0.Middleware) => Promise<{ context: { headers: Headers; }; } | undefined>>; }[]; after: { matcher(context: better_auth0.HookEndpointContext): true; handler: better_call0.Middleware) => Promise>; }[]; }; options: better_auth_plugins0.BearerOptions | undefined; }, { id: "oauth-proxy"; version: string; options: NoInfer; endpoints: { oAuthProxy: better_call0.StrictEndpoint<"/oauth-proxy-callback", { method: "GET"; operationId: string; query: zod0.ZodObject<{ callbackURL: zod0.ZodString; profile: zod0.ZodOptional; }, zod_v4_core0.$strip>; use: better_call0.Middleware) => Promise>[]; metadata: { openapi: { operationId: string; deprecated: boolean; description: string; parameters: ({ in: "query"; name: string; required: true; description: string; } | { in: "query"; name: string; required: false; description: string; })[]; responses: { 302: { description: string; headers: { Location: { description: string; schema: { type: string; }; }; }; }; }; }; }; }, never>; oAuthProxyCompletion: better_call0.StrictEndpoint<"/callback/:id/oauth-proxy", { method: "GET"; operationId: string; query: zod0.ZodObject<{ callbackURL: zod0.ZodString; profile: zod0.ZodOptional; }, zod_v4_core0.$strip>; use: better_call0.Middleware) => Promise>[]; metadata: { scope: "http"; }; }, never>; }; hooks: { before: { matcher(context: better_auth0.HookEndpointContext): boolean; handler: better_call0.Middleware) => Promise>; }[]; after: { matcher(context: better_auth0.HookEndpointContext): boolean; handler: better_call0.Middleware) => Promise>; }[]; }; }, { id: "jwt"; version: string; options: NoInfer; init(ctx: better_auth0.AuthContext): { context: { sessionConfig: { cookieCacheSigner: better_auth0.CookieCacheSigner; updateAge: number; expiresIn: number; freshAge: number; cookieRefreshCache: false | { enabled: true; updateAge: number; }; }; }; } | undefined; endpoints: { getJwks: better_call0.StrictEndpoint; getToken: better_call0.StrictEndpoint<"/token", { method: "GET"; requireHeaders: true; use: better_call0.Middleware) => Promise<{ session: { session: Record & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; }; }; }>>[]; metadata: { openapi: { operationId: string; description: string; responses: { 200: { description: string; content: { "application/json": { schema: { type: "object"; properties: { token: { type: string; }; }; }; }; }; }; }; }; }; }, { token: string; }>; signJWT: better_call0.StrictEndpoint; overrideOptions: zod0.ZodOptional>; }, zod_v4_core0.$strip>; }, { token: string; }>; verifyJWT: better_call0.StrictEndpoint; }, zod_v4_core0.$strip>; }, { payload: (jose0.JWTPayload & Required>) | null; }>; }; hooks: { after: { matcher(context: better_auth0.HookEndpointContext): boolean; handler: better_call0.Middleware) => Promise>; }[]; }; schema: { jwks: { fields: { publicKey: { type: "string"; required: true; }; privateKey: { type: "string"; required: true; }; createdAt: { type: "date"; required: true; }; expiresAt: { type: "date"; required: false; }; alg: { type: "string"; required: false; }; crv: { type: "string"; required: false; }; }; }; }; }, { id: "oauth-provider"; version: string; options: NoInfer<{ loginPage: string; consentPage: string; }>; onRequest: (request: Request, ctx: better_auth0.AuthContext) => Promise<{ response: Response; } | { request: Request; } | void>; init: (ctx: better_auth0.AuthContext) => Promise<{ options: { databaseHooks: { session: { delete: { before(session: { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; } & Record, hookCtx: better_auth0.GenericEndpointContext | null): Promise; after(session: { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; } & Record, hookCtx: better_auth0.GenericEndpointContext | null): Promise; }; }; }; }; }>; hooks: { before: { matcher(ctx: better_auth0.HookEndpointContext): any; handler: better_call0.Middleware) => Promise>; }[]; after: { matcher(ctx: better_auth0.HookEndpointContext): boolean; handler: better_call0.Middleware) => Promise<{ redirect: true; url: string; } | undefined>>; }[]; }; endpoints: { getOAuthServerConfig: better_call0.StrictEndpoint<"/.well-known/oauth-authorization-server", { method: "GET"; metadata: { SERVER_ONLY: true; }; }, _better_auth_oauth_provider0.AuthServerMetadata>; getOpenIdConfig: better_call0.StrictEndpoint<"/.well-known/openid-configuration", { method: "GET"; metadata: { SERVER_ONLY: true; }; }, { jwks_uri?: string | undefined; userinfo_endpoint: string; acr_values_supported?: string[] | undefined; subject_types_supported: ("public" | "pairwise")[]; claims_supported: string[]; claims_parameter_supported?: boolean | undefined; end_session_endpoint: string; request_parameter_supported?: boolean | undefined; request_uri_parameter_supported?: boolean | undefined; prompt_values_supported: _better_auth_oauth_provider0.Prompt[]; issuer: string; authorization_endpoint: string; token_endpoint: string; registration_endpoint?: string | undefined; scopes_supported?: string[] | undefined; response_types_supported: "code"[]; response_modes_supported: "query"[]; grant_types_supported: _better_auth_oauth_provider0.GrantType[]; token_endpoint_auth_methods_supported?: _better_auth_oauth_provider0.TokenEndpointAuthMethod[] | undefined; token_endpoint_auth_signing_alg_values_supported?: better_auth0.PrivateKeyJwtSigningAlgorithm[] | undefined; service_documentation?: string | undefined; ui_locales_supported?: string[] | undefined; op_policy_uri?: string | undefined; op_tos_uri?: string | undefined; revocation_endpoint?: string | undefined; revocation_endpoint_auth_methods_supported?: _better_auth_oauth_provider0.TokenEndpointAuthMethod[] | undefined; revocation_endpoint_auth_signing_alg_values_supported?: better_auth0.PrivateKeyJwtSigningAlgorithm[] | undefined; introspection_endpoint?: string | undefined; introspection_endpoint_auth_methods_supported?: _better_auth_oauth_provider0.TokenEndpointAuthMethod[] | undefined; introspection_endpoint_auth_signing_alg_values_supported?: better_auth0.PrivateKeyJwtSigningAlgorithm[] | undefined; code_challenge_methods_supported: "S256"[]; authorization_response_iss_parameter_supported?: boolean | undefined; client_id_metadata_document_supported?: boolean | undefined; backchannel_logout_supported?: boolean | undefined; backchannel_logout_session_supported?: boolean | undefined; dpop_signing_alg_values_supported?: better_auth_plugins0.JWSAlgorithms[] | undefined; id_token_signing_alg_values_supported: better_auth_plugins0.JWSAlgorithms[] | ["HS256"]; }>; oauth2Authorize: better_call0.StrictEndpoint<"/oauth2/authorize", { method: ("GET" | "POST")[]; body: zod0.ZodObject<{}, zod_v4_core0.$loose>; redirectOnError: _better_auth_oauth_provider0.OAuthRedirectOnError; metadata: { allowedMediaTypes: string[]; openapi: { description: string; parameters: ({ name: string; in: "query"; required: false; schema: { type: "string"; format?: undefined; minimum?: undefined; items?: undefined; }; description: string; } | { name: string; in: "query"; required: true; schema: { type: "string"; format?: undefined; minimum?: undefined; items?: undefined; }; description: string; } | { name: string; in: "query"; required: false; schema: { type: "string"; format: string; minimum?: undefined; items?: undefined; }; description: string; } | { name: string; in: "query"; required: false; schema: { type: "integer"; minimum: number; format?: undefined; items?: undefined; }; description: string; } | { name: string; in: "query"; required: false; schema: { type: "array"; items: { type: "string"; }; format?: undefined; minimum?: undefined; }; description: string; })[]; responses: { "302": { description: string; headers: { Location: { description: string; schema: { type: string; format: string; }; }; }; }; "400": { description: string; content: { "application/json": { schema: { type: "object"; properties: { error: { type: string; }; error_description: { type: string; }; state: { type: string; }; }; required: string[]; }; }; }; }; }; }; }; }, { redirect: true; url: string; }>; oauth2Consent: better_call0.StrictEndpoint<"/oauth2/consent", { method: "POST"; body: zod0.ZodObject<{ accept: zod0.ZodBoolean; scope: zod0.ZodOptional; claims: zod0.ZodOptional]>>; oauth_query: zod0.ZodOptional; }, zod_v4_core0.$strip>; use: better_call0.Middleware) => Promise<{ session: { session: Record & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; }; }; }>>[]; metadata: { openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; properties: { redirect: { type: string; description: string; enum: boolean[]; }; url: { type: string; format: string; description: string; }; }; required: string[]; }; }; }; }; }; }; }; }, { redirect: true; url: string; } | { redirect: boolean; url: string; }>; oauth2Continue: better_call0.StrictEndpoint<"/oauth2/continue", { method: "POST"; body: zod0.ZodObject<{ selected: zod0.ZodOptional; created: zod0.ZodOptional; postLogin: zod0.ZodOptional; oauth_query: zod0.ZodOptional; }, zod_v4_core0.$strip>; use: better_call0.Middleware) => Promise<{ session: { session: Record & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; }; }; }>>[]; metadata: { openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; properties: { redirect: { type: string; description: string; enum: boolean[]; }; url: { type: string; format: string; description: string; }; }; required: string[]; }; }; }; }; }; }; }; }, { redirect: true; url: string; }>; oauth2Token: better_call0.StrictEndpoint<"/oauth2/token", { method: "POST"; cloneRequest: true; body: zod0.ZodObject<{ grant_type: zod0.ZodString; client_id: zod0.ZodOptional; client_secret: zod0.ZodOptional; client_assertion: zod0.ZodOptional; client_assertion_type: zod0.ZodOptional; code: zod0.ZodOptional; code_verifier: zod0.ZodOptional; redirect_uri: zod0.ZodOptional; refresh_token: zod0.ZodOptional; resource: zod0.ZodOptional]>>; scope: zod0.ZodOptional; }, zod_v4_core0.$loose>; errorCodesByField: { grant_type: { missing: "invalid_request"; invalid: "unsupported_grant_type"; }; resource: { invalid: "invalid_target"; }; }; metadata: { noStore: boolean; allowedMediaTypes: string[]; openapi: { description: string; parameters: { name: string; in: "header"; required: false; schema: { type: "string"; }; description: string; }[]; requestBody: { required: boolean; content: { "application/json": { schema: { type: "object"; properties: { grant_type: { type: string; description: string; }; client_id: { type: string; description: string; }; client_secret: { type: string; description: string; }; code: { type: string; description: string; }; code_verifier: { type: string; description: string; }; redirect_uri: { type: string; format: string; description: string; }; refresh_token: { type: string; description: string; }; resource: { oneOf: ({ type: string; description: string; items?: undefined; } | { type: string; items: { type: string; }; description: string; })[]; description: string; }; scope: { type: string; description: string; }; }; required: string[]; }; }; }; }; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; properties: { access_token: { type: string; description: string; }; token_type: { type: string; description: string; enum: string[]; }; expires_in: { type: string; description: string; }; refresh_token: { type: string; description: string; }; scope: { type: string; description: string; }; id_token: { type: string; description: string; }; }; required: string[]; }; }; }; }; "400": { description: string; content: { "application/json": { schema: { type: "object"; properties: { error: { type: string; }; error_description: { type: string; }; error_uri: { type: string; }; }; required: string[]; }; }; }; }; }; }; }; }, { expires_in: number; access_token: string; expires_at: number; token_type: _better_auth_oauth_provider0.TokenType; refresh_token: string | undefined; scope: string; id_token: string | undefined; }>; oauth2Introspect: better_call0.StrictEndpoint<"/oauth2/introspect", { method: "POST"; cloneRequest: true; body: zod0.ZodObject<{ client_id: zod0.ZodOptional; client_secret: zod0.ZodOptional; client_assertion: zod0.ZodOptional; client_assertion_type: zod0.ZodOptional; token: zod0.ZodString; token_type_hint: zod0.ZodOptional; }, zod_v4_core0.$strip>; metadata: { noStore: boolean; allowedMediaTypes: string[]; openapi: { description: string; requestBody: { required: boolean; content: { "application/json": { schema: { type: "object"; properties: { client_id: { type: string; description: string; }; client_secret: { type: string; description: string; }; token: { type: string; description: string; }; token_type_hint: { type: string; description: string; }; }; required: string[]; }; }; }; }; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; properties: { active: { type: string; description: string; }; scope: { type: string; description: string; }; client_id: { type: string; description: string; }; username: { type: string; description: string; }; token_type: { type: string; description: string; }; exp: { type: string; description: string; }; iat: { type: string; description: string; }; nbf: { type: string; description: string; }; sub: { type: string; description: string; }; aud: { type: string; description: string; }; iss: { type: string; description: string; }; jti: { type: string; description: string; }; }; required: string[]; }; }; }; }; "400": { description: string; content: { "application/json": { schema: { type: "object"; properties: { error: { type: string; }; error_description: { type: string; }; error_uri: { type: string; }; }; required: string[]; }; }; }; }; }; }; }; }, jose0.JWTPayload>; oauth2Revoke: better_call0.StrictEndpoint<"/oauth2/revoke", { method: "POST"; cloneRequest: true; body: zod0.ZodObject<{ client_id: zod0.ZodOptional; client_secret: zod0.ZodOptional; client_assertion: zod0.ZodOptional; client_assertion_type: zod0.ZodOptional; token: zod0.ZodString; token_type_hint: zod0.ZodOptional; }, zod_v4_core0.$strip>; metadata: { allowedMediaTypes: string[]; openapi: { description: string; requestBody: { required: boolean; content: { "application/json": { schema: { type: "object"; properties: { client_id: { type: string; description: string; }; client_secret: { type: string; description: string; }; token: { type: string; description: string; }; token_type_hint: { type: string; description: string; }; }; required: string[]; }; }; }; }; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; description: string; }; }; }; }; "400": { description: string; content: { "application/json": { schema: { type: "object"; properties: { error: { type: string; }; error_description: { type: string; }; error_uri: { type: string; }; }; required: string[]; }; }; }; }; }; }; }; }, null | undefined>; oauth2UserInfo: better_call0.StrictEndpoint<"/oauth2/userinfo", { method: ("GET" | "POST")[]; body: zod0.ZodOptional; }, zod_v4_core0.$loose>>; metadata: { noStore: boolean; allowedMediaTypes: string[]; openapi: { description: string; security: ({ bearerAuth: never[]; OAuth2?: undefined; } | { OAuth2: string[]; bearerAuth?: undefined; })[]; parameters: { name: string; in: "header"; required: false; schema: { type: "string"; }; description: string; }[]; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; properties: { sub: { type: string; description: string; }; email: { type: string; format: string; nullable: boolean; description: string; }; name: { type: string; nullable: boolean; description: string; }; picture: { type: string; format: string; nullable: boolean; description: string; }; given_name: { type: string; nullable: boolean; description: string; }; family_name: { type: string; nullable: boolean; description: string; }; email_verified: { type: string; nullable: boolean; description: string; }; }; required: string[]; }; }; }; }; "401": { description: string; content: { "application/json": { schema: { type: "object"; properties: { error: { type: string; }; error_description: { type: string; }; }; required: string[]; }; }; }; }; "403": { description: string; content: { "application/json": { schema: { type: "object"; properties: { error: { type: string; }; error_description: { type: string; }; }; required: string[]; }; }; }; }; }; }; }; }, { sub: unknown; }>; oauth2EndSession: better_call0.StrictEndpoint<"/oauth2/end-session", { method: ("GET" | "POST")[]; body: zod0.ZodOptional; client_id: zod0.ZodOptional; post_logout_redirect_uri: zod0.ZodOptional; state: zod0.ZodOptional; }, zod_v4_core0.$strip>>; query: zod0.ZodOptional; client_id: zod0.ZodOptional; post_logout_redirect_uri: zod0.ZodOptional; state: zod0.ZodOptional; }, zod_v4_core0.$strip>>; metadata: { noStore: boolean; allowedMediaTypes: string[]; $Infer: { body: { id_token_hint?: string; client_id?: string; post_logout_redirect_uri?: string; state?: string; } | { query: { id_token_hint?: string; client_id?: string; post_logout_redirect_uri?: string; state?: string; }; }; query: { id_token_hint?: string; client_id?: string; post_logout_redirect_uri?: string; state?: string; }; }; openapi: { description: string; responses: { "200": { description: string; content: { "application/json": { schema: { type: "object"; properties: { redirect_uri: { type: string; format: string; description: string; }; message: { type: string; description: string; }; }; }; }; "text/html": { schema: { type: "string"; }; }; }; }; }; }; }; }, Response | { redirect: true; url: string; } | null>; oauth2EndSessionConfirmation: better_call0.StrictEndpoint<"/oauth2/end-session/confirm", { method: "POST"; body: zod0.ZodObject<{ action: zod0.ZodLiteral<"confirm">; }, zod_v4_core0.$strip>; metadata: { noStore: boolean; allowedMediaTypes: string[]; scope: "http"; }; }, Response | { redirect: true; url: string; } | null>; registerOAuthClient: better_call0.StrictEndpoint<"/oauth2/register", { method: "POST"; body: zod0.ZodObject<{ redirect_uris: zod0.ZodOptional>; scope: zod0.ZodOptional; client_name: zod0.ZodOptional; client_uri: zod0.ZodOptional; logo_uri: zod0.ZodOptional; contacts: zod0.ZodOptional>; tos_uri: zod0.ZodOptional; policy_uri: zod0.ZodOptional; software_id: zod0.ZodOptional; software_version: zod0.ZodOptional; software_statement: zod0.ZodOptional; post_logout_redirect_uris: zod0.ZodOptional>; backchannel_logout_uri: zod0.ZodOptional; backchannel_logout_session_required: zod0.ZodOptional; token_endpoint_auth_method: zod0.ZodOptional; jwks: zod0.ZodOptional>; }, zod_v4_core0.$strip>>; jwks_uri: zod0.ZodOptional; grant_types: zod0.ZodOptional>; response_types: zod0.ZodOptional>>; application_type: zod0.ZodOptional>; subject_type: zod0.ZodOptional>; dpop_bound_access_tokens: zod0.ZodOptional; resources: zod0.ZodOptional>; skip_consent: zod0.ZodOptional; }, zod_v4_core0.$strip>; errorCodesByField: { redirect_uris: "invalid_redirect_uri"; post_logout_redirect_uris: "invalid_redirect_uri"; software_statement: "invalid_software_statement"; resources: "invalid_target"; }; defaultError: "invalid_client_metadata"; metadata: { noStore: boolean; openapi: { description: string; responses: { "201": { description: string; content: { "application/json": { schema: { type: "object"; properties: { client_id: { type: string; description: string; }; client_secret: { type: string; description: string; }; client_secret_expires_at: { type: string; description: string; }; scope: { type: string; description: string; }; user_id: { type: string; description: string; }; client_id_issued_at: { type: string; description: string; }; client_name: { type: string; description: string; }; client_uri: { type: string; description: string; }; logo_uri: { type: string; description: string; }; contacts: { type: string; items: { type: string; }; description: string; }; tos_uri: { type: string; description: string; }; policy_uri: { type: string; description: string; }; software_id: { type: string; description: string; }; software_version: { type: string; description: string; }; software_statement: { type: string; description: string; }; redirect_uris: { type: string; items: { type: string; format: string; }; description: string; }; post_logout_redirect_uris: { type: string; items: { type: string; format: string; }; description: string; }; backchannel_logout_uri: { type: string; format: string; description: string; }; backchannel_logout_session_required: { type: string; description: string; }; token_endpoint_auth_method: { type: string; description: string; }; grant_types: { type: string; items: { type: string; }; description: string; }; response_types: { type: string; items: { type: string; enum: string[]; }; description: string; }; application_type: { type: string; description: string; enum: string[]; }; resources: { type: string; items: { type: string; format: string; }; description: string; }; disabled: { type: string; description: string; }; }; required: string[]; }; }; }; }; }; }; }; }, _better_auth_oauth_provider0.OAuthClientRegistrationResponse>; adminCreateOAuthClient: better_call0.StrictEndpoint<"/admin/oauth2/create-client", { method: "POST"; body: zod0.ZodObject<{ redirect_uris: zod0.ZodOptional>; scope: zod0.ZodOptional; client_name: zod0.ZodOptional; client_uri: zod0.ZodOptional; logo_uri: zod0.ZodOptional; contacts: zod0.ZodOptional>; tos_uri: zod0.ZodOptional; policy_uri: zod0.ZodOptional; software_id: zod0.ZodOptional; software_version: zod0.ZodOptional; software_statement: zod0.ZodOptional; post_logout_redirect_uris: zod0.ZodOptional>; backchannel_logout_uri: zod0.ZodOptional; backchannel_logout_session_required: zod0.ZodOptional; token_endpoint_auth_method: zod0.ZodOptional; application_type: zod0.ZodOptional>; jwks: zod0.ZodOptional>; }, zod_v4_core0.$strip>>; jwks_uri: zod0.ZodOptional; grant_types: zod0.ZodOptional>; client_credentials_scopes: zod0.ZodOptional>; resources: zod0.ZodOptional>; response_types: zod0.ZodOptional>>; client_secret_expires_at: zod0.ZodDefault>>; skip_consent: zod0.ZodOptional; enable_end_session: zod0.ZodOptional; require_pkce: zod0.ZodOptional; dpop_bound_access_tokens: zod0.ZodOptional; subject_type: zod0.ZodOptional>; metadata: zod0.ZodOptional>; }, zod_v4_core0.$strip>; metadata: { noStore: boolean; SERVER_ONLY: true; openapi: { description: string; responses: { "201": { description: string; content: { "application/json": { schema: { type: "object"; properties: { client_id: { type: string; description: string; }; client_secret: { type: string; description: string; }; client_secret_expires_at: { type: string; description: string; }; scope: { type: string; description: string; }; client_credentials_scopes: { type: string; items: { type: string; }; description: string; }; user_id: { type: string; description: string; }; client_id_issued_at: { type: string; description: string; }; client_name: { type: string; description: string; }; client_uri: { type: string; description: string; }; logo_uri: { type: string; description: string; }; contacts: { type: string; items: { type: string; }; description: string; }; tos_uri: { type: string; description: string; }; policy_uri: { type: string; description: string; }; software_id: { type: string; description: string; }; software_version: { type: string; description: string; }; software_statement: { type: string; description: string; }; redirect_uris: { type: string; items: { type: string; format: string; }; description: string; }; token_endpoint_auth_method: { type: string; description: string; }; grant_types: { type: string; items: { type: string; }; description: string; }; response_types: { type: string; items: { type: string; enum: string[]; }; description: string; }; application_type: { type: string; description: string; enum: string[]; }; resources: { type: string; items: { type: string; format: string; }; description: string; }; disabled: { type: string; description: string; }; require_pkce: { type: string; description: string; default: boolean; }; metadata: { type: string; additionalProperties: boolean; nullable: boolean; description: string; }; }; required: string[]; }; }; }; }; }; }; }; }, _better_auth_oauth_provider0.OAuthClientAdministrativeResponse>; createOAuthClient: better_call0.StrictEndpoint<"/oauth2/create-client", { method: "POST"; use: better_call0.Middleware) => Promise<{ session: { session: Record & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; }; }; }>>[]; body: zod0.ZodObject<{ redirect_uris: zod0.ZodOptional>; scope: zod0.ZodOptional; client_name: zod0.ZodOptional; client_uri: zod0.ZodOptional; logo_uri: zod0.ZodOptional; contacts: zod0.ZodOptional>; tos_uri: zod0.ZodOptional; policy_uri: zod0.ZodOptional; software_id: zod0.ZodOptional; software_version: zod0.ZodOptional; software_statement: zod0.ZodOptional; post_logout_redirect_uris: zod0.ZodOptional>; backchannel_logout_uri: zod0.ZodOptional; backchannel_logout_session_required: zod0.ZodOptional; token_endpoint_auth_method: zod0.ZodOptional; application_type: zod0.ZodOptional>; jwks: zod0.ZodOptional>; }, zod_v4_core0.$strip>>; jwks_uri: zod0.ZodOptional; grant_types: zod0.ZodOptional>; response_types: zod0.ZodOptional>>; dpop_bound_access_tokens: zod0.ZodOptional; }, zod_v4_core0.$strip>; metadata: { noStore: boolean; openapi: { description: string; responses: { "201": { description: string; content: { "application/json": { schema: { type: "object"; properties: { client_id: { type: string; description: string; }; client_secret: { type: string; description: string; }; client_secret_expires_at: { type: string; description: string; }; scope: { type: string; description: string; }; user_id: { type: string; description: string; }; client_id_issued_at: { type: string; description: string; }; client_name: { type: string; description: string; }; client_uri: { type: string; description: string; }; logo_uri: { type: string; description: string; }; contacts: { type: string; items: { type: string; }; description: string; }; tos_uri: { type: string; description: string; }; policy_uri: { type: string; description: string; }; software_id: { type: string; description: string; }; software_version: { type: string; description: string; }; software_statement: { type: string; description: string; }; redirect_uris: { type: string; items: { type: string; format: string; }; description: string; }; token_endpoint_auth_method: { type: string; description: string; }; grant_types: { type: string; items: { type: string; }; description: string; }; response_types: { type: string; items: { type: string; enum: string[]; }; description: string; }; application_type: { type: string; description: string; enum: string[]; }; resources: { type: string; items: { type: string; format: string; }; description: string; }; disabled: { type: string; description: string; }; metadata: { type: string; additionalProperties: boolean; nullable: boolean; description: string; }; }; required: string[]; }; }; }; }; }; }; }; }, _better_auth_oauth_provider0.OAuthClientRegistrationResponse>; getOAuthClient: better_call0.StrictEndpoint<"/oauth2/get-client", { method: "GET"; use: better_call0.Middleware) => Promise<{ session: { session: Record & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; }; }; }>>[]; query: zod0.ZodObject<{ client_id: zod0.ZodString; }, zod_v4_core0.$strip>; metadata: { openapi: { description: string; }; }; }, _better_auth_oauth_provider0.OAuthClient>; getOAuthClientPublic: better_call0.StrictEndpoint<"/oauth2/public-client", { method: "GET"; use: better_call0.Middleware) => Promise<{ session: { session: Record & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; }; }; }>>[]; query: zod0.ZodObject<{ client_id: zod0.ZodString; }, zod_v4_core0.$strip>; metadata: { openapi: { description: string; }; }; }, _better_auth_oauth_provider0.OAuthClient>; getOAuthClientPublicPrelogin: better_call0.StrictEndpoint<"/oauth2/public-client-prelogin", { method: "POST"; use: better_call0.Middleware) => Promise>[]; body: zod0.ZodObject<{ client_id: zod0.ZodString; oauth_query: zod0.ZodOptional; }, zod_v4_core0.$strip>; metadata: { openapi: { description: string; }; }; }, _better_auth_oauth_provider0.OAuthClient>; getOAuthClients: better_call0.StrictEndpoint<"/oauth2/get-clients", { method: "GET"; use: better_call0.Middleware) => Promise<{ session: { session: Record & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; }; }; }>>[]; metadata: { openapi: { description: string; }; }; }, _better_auth_oauth_provider0.OAuthClient[] | null>; adminUpdateOAuthClient: better_call0.StrictEndpoint<"/admin/oauth2/update-client", { method: "PATCH"; body: zod0.ZodObject<{ client_id: zod0.ZodString; update: zod0.ZodObject<{ redirect_uris: zod0.ZodOptional>; scope: zod0.ZodOptional; client_name: zod0.ZodOptional; client_uri: zod0.ZodOptional; logo_uri: zod0.ZodOptional; contacts: zod0.ZodOptional>; tos_uri: zod0.ZodOptional; policy_uri: zod0.ZodOptional; software_id: zod0.ZodOptional; software_version: zod0.ZodOptional; software_statement: zod0.ZodOptional; post_logout_redirect_uris: zod0.ZodOptional>; backchannel_logout_uri: zod0.ZodOptional; backchannel_logout_session_required: zod0.ZodOptional; application_type: zod0.ZodOptional>; grant_types: zod0.ZodOptional>; client_credentials_scopes: zod0.ZodOptional>; response_types: zod0.ZodOptional>>; client_secret_expires_at: zod0.ZodOptional>; skip_consent: zod0.ZodOptional; enable_end_session: zod0.ZodOptional; disabled: zod0.ZodOptional; dpop_bound_access_tokens: zod0.ZodOptional; metadata: zod0.ZodOptional>; }, zod_v4_core0.$strip>; }, zod_v4_core0.$strip>; metadata: { SERVER_ONLY: true; openapi: { description: string; }; }; }, _better_auth_oauth_provider0.OAuthClientAdministrativeResponse>; updateOAuthClient: better_call0.StrictEndpoint<"/oauth2/update-client", { method: "POST"; use: better_call0.Middleware) => Promise<{ session: { session: Record & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; }; }; }>>[]; body: zod0.ZodObject<{ client_id: zod0.ZodString; update: zod0.ZodObject<{ redirect_uris: zod0.ZodOptional>; scope: zod0.ZodOptional; client_name: zod0.ZodOptional; client_uri: zod0.ZodOptional; logo_uri: zod0.ZodOptional; contacts: zod0.ZodOptional>; tos_uri: zod0.ZodOptional; policy_uri: zod0.ZodOptional; software_id: zod0.ZodOptional; software_version: zod0.ZodOptional; software_statement: zod0.ZodOptional; post_logout_redirect_uris: zod0.ZodOptional>; backchannel_logout_uri: zod0.ZodOptional; backchannel_logout_session_required: zod0.ZodOptional; application_type: zod0.ZodOptional>; grant_types: zod0.ZodOptional>; response_types: zod0.ZodOptional>>; }, zod_v4_core0.$strip>; }, zod_v4_core0.$strip>; metadata: { openapi: { description: string; }; }; }, _better_auth_oauth_provider0.OAuthClientRegistrationResponse>; rotateClientSecret: better_call0.StrictEndpoint<"/oauth2/client/rotate-secret", { method: "POST"; use: better_call0.Middleware) => Promise<{ session: { session: Record & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; }; }; }>>[]; body: zod0.ZodObject<{ client_id: zod0.ZodString; }, zod_v4_core0.$strip>; metadata: { noStore: boolean; openapi: { description: string; }; }; }, _better_auth_oauth_provider0.OAuthClient>; rotateClientKeys: better_call0.StrictEndpoint<"/oauth2/client/rotate-keys", { method: "POST"; body: zod0.ZodObject<{ client_assertion: zod0.ZodString; client_assertion_type: zod0.ZodString; jwks: zod0.ZodObject<{ keys: zod0.ZodArray>; }, zod_v4_core0.$strip>; }, zod_v4_core0.$strip>; errorCodesByField: { client_assertion: "invalid_client"; client_assertion_type: "invalid_client"; jwks: "invalid_client_metadata"; }; metadata: { noStore: boolean; openapi: { description: string; }; }; }, { client_id: string; jwks: { keys: Record[]; }; }>; deleteOAuthClient: better_call0.StrictEndpoint<"/oauth2/delete-client", { method: "POST"; use: better_call0.Middleware) => Promise<{ session: { session: Record & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; }; }; }>>[]; body: zod0.ZodObject<{ client_id: zod0.ZodString; }, zod_v4_core0.$strip>; metadata: { openapi: { description: string; }; }; }, void>; getOAuthConsent: better_call0.StrictEndpoint<"/oauth2/get-consent", { method: "GET"; query: zod0.ZodObject<{ id: zod0.ZodString; }, zod_v4_core0.$strip>; use: better_call0.Middleware) => Promise<{ session: { session: Record & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; }; }; }>>[]; metadata: { openapi: { description: string; }; }; }, _better_auth_oauth_provider0.OAuthConsent<_better_auth_oauth_provider0.Scope[]>>; getOAuthConsents: better_call0.StrictEndpoint<"/oauth2/get-consents", { method: "GET"; use: better_call0.Middleware) => Promise<{ session: { session: Record & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; }; }; }>>[]; metadata: { openapi: { description: string; }; }; }, _better_auth_oauth_provider0.OAuthConsent<_better_auth_oauth_provider0.Scope[]>[]>; updateOAuthConsent: better_call0.StrictEndpoint<"/oauth2/update-consent", { method: "POST"; use: better_call0.Middleware) => Promise<{ session: { session: Record & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; }; }; }>>[]; body: zod0.ZodObject<{ id: zod0.ZodString; update: zod0.ZodObject<{ scopes: zod0.ZodArray; }, zod_v4_core0.$strip>; }, zod_v4_core0.$strip>; metadata: { openapi: { description: string; }; }; }, _better_auth_oauth_provider0.OAuthConsent<_better_auth_oauth_provider0.Scope[]> | null>; deleteOAuthConsent: better_call0.StrictEndpoint<"/oauth2/delete-consent", { method: "POST"; use: better_call0.Middleware) => Promise<{ session: { session: Record & { id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; userAgent?: string | null | undefined; }; user: Record & { id: string; createdAt: Date; updatedAt: Date; email: string; emailVerified: boolean; name: string; image?: string | null | undefined; }; }; }>>[]; body: zod0.ZodObject<{ id: zod0.ZodString; }, zod_v4_core0.$strip>; metadata: { openapi: { description: string; }; }; }, void>; adminCreateOAuthResource: better_call0.StrictEndpoint<"/admin/oauth2/resources", { method: "POST"; body: zod0.ZodObject<{ identifier: zod0.ZodNonOptional>; name: zod0.ZodOptional; accessTokenTtl: zod0.ZodOptional>; refreshTokenTtl: zod0.ZodOptional>; signingAlgorithm: zod0.ZodOptional>>; signingKeyId: zod0.ZodOptional>; allowedScopes: zod0.ZodOptional>>; customClaims: zod0.ZodOptional>>; dpopBoundAccessTokensRequired: zod0.ZodOptional; disabled: zod0.ZodOptional; metadata: zod0.ZodOptional>>; }, zod_v4_core0.$strip>; metadata: { SERVER_ONLY: true; }; }, _better_auth_oauth_provider0.OAuthResource>; adminListOAuthResources: better_call0.StrictEndpoint<"/admin/oauth2/resources", { method: "GET"; metadata: { SERVER_ONLY: true; }; }, _better_auth_oauth_provider0.OAuthResource[]>; adminGetOAuthResource: better_call0.StrictEndpoint<"/admin/oauth2/resources/:identifier", { method: "GET"; metadata: { SERVER_ONLY: true; }; }, _better_auth_oauth_provider0.OAuthResource>; adminUpdateOAuthResource: better_call0.StrictEndpoint<"/admin/oauth2/resources/:identifier", { method: "PATCH"; body: zod0.ZodObject<{ identifier: zod0.ZodOptional; name: zod0.ZodOptional; accessTokenTtl: zod0.ZodOptional>; refreshTokenTtl: zod0.ZodOptional>; signingAlgorithm: zod0.ZodOptional>>; signingKeyId: zod0.ZodOptional>; allowedScopes: zod0.ZodOptional>>; customClaims: zod0.ZodOptional>>; dpopBoundAccessTokensRequired: zod0.ZodOptional; disabled: zod0.ZodOptional; metadata: zod0.ZodOptional>>; }, zod_v4_core0.$strip>; metadata: { SERVER_ONLY: true; }; }, _better_auth_oauth_provider0.OAuthResource>; adminDeleteOAuthResource: better_call0.StrictEndpoint<"/admin/oauth2/resources/:identifier", { method: "DELETE"; metadata: { SERVER_ONLY: true; }; }, { deleted: boolean; }>; adminLinkClientResource: better_call0.StrictEndpoint<"/admin/oauth2/resources/:identifier/clients/:client_id", { method: "POST"; metadata: { SERVER_ONLY: true; }; }, { linked: boolean; }>; adminUnlinkClientResource: better_call0.StrictEndpoint<"/admin/oauth2/resources/:identifier/clients/:client_id", { method: "DELETE"; metadata: { SERVER_ONLY: true; }; }, { unlinked: boolean; }>; }; schema: { oauthClient: { modelName: string; fields: { clientId: { type: "string"; unique: true; required: true; }; clientSecret: { type: "string"; required: false; }; clientDiscoveryId: { type: "string"; required: false; }; disabled: { type: "boolean"; defaultValue: false; required: false; }; skipConsent: { type: "boolean"; required: false; }; enableEndSession: { type: "boolean"; required: false; }; subjectType: { type: "string"; required: false; }; scopes: { type: "string[]"; required: false; }; clientCredentialsScopes: { type: "string[]"; required: false; defaultValue: never[]; }; userId: { type: "string"; required: false; references: { model: string; field: string; }; index: true; }; createdAt: { type: "date"; required: false; }; updatedAt: { type: "date"; required: false; }; name: { type: "string"; required: false; }; uri: { type: "string"; required: false; }; icon: { type: "string"; required: false; }; contacts: { type: "string[]"; required: false; }; tos: { type: "string"; required: false; }; policy: { type: "string"; required: false; }; softwareId: { type: "string"; required: false; }; softwareVersion: { type: "string"; required: false; }; softwareStatement: { type: "string"; required: false; }; redirectUris: { type: "string[]"; required: true; }; postLogoutRedirectUris: { type: "string[]"; required: false; }; backchannelLogoutUri: { type: "string"; required: false; }; backchannelLogoutSessionRequired: { type: "boolean"; required: false; }; tokenEndpointAuthMethod: { type: "string"; required: false; }; applicationType: { type: "string"; required: false; }; jwks: { type: "string"; required: false; }; jwksUri: { type: "string"; required: false; }; grantTypes: { type: "string[]"; required: false; }; responseTypes: { type: "string[]"; required: false; }; requirePKCE: { type: "boolean"; required: false; }; dpopBoundAccessTokens: { type: "boolean"; required: false; defaultValue: false; }; referenceId: { type: "string"; required: false; }; metadata: { type: "json"; required: false; }; }; }; oauthResource: { modelName: string; fields: { identifier: { type: "string"; required: true; unique: true; }; name: { type: "string"; required: true; }; accessTokenTtl: { type: "number"; required: false; }; refreshTokenTtl: { type: "number"; required: false; }; signingAlgorithm: { type: "string"; required: false; }; signingKeyId: { type: "string"; required: false; }; allowedScopes: { type: "string[]"; required: false; }; customClaims: { type: "json"; required: false; }; dpopBoundAccessTokensRequired: { type: "boolean"; required: false; defaultValue: false; }; disabled: { type: "boolean"; required: false; defaultValue: false; }; createdAt: { type: "date"; required: false; }; updatedAt: { type: "date"; required: false; }; policyVersion: { type: "number"; required: false; defaultValue: number; }; metadata: { type: "json"; required: false; }; }; }; oauthClientResource: { modelName: string; fields: { clientId: { type: "string"; required: true; references: { model: string; field: string; onDelete: "cascade"; }; index: true; }; resourceId: { type: "string"; required: true; references: { model: string; field: string; onDelete: "cascade"; }; index: true; }; metadata: { type: "json"; required: false; }; createdAt: { type: "date"; required: false; }; }; indexes: { fields: [string, string]; unique: true; }[]; }; oauthRefreshToken: { fields: { token: { type: "string"; required: true; unique: true; }; clientId: { type: "string"; required: true; references: { model: string; field: string; }; index: true; }; sessionId: { type: "string"; required: false; references: { model: string; field: string; onDelete: "set null"; }; index: true; }; userId: { type: "string"; required: true; references: { model: string; field: string; }; index: true; }; referenceId: { type: "string"; required: false; }; authorizationCodeId: { type: "string"; required: false; index: true; }; resources: { type: "string[]"; required: false; }; requestedUserInfoClaims: { type: "string[]"; required: false; }; expiresAt: { type: "date"; }; createdAt: { type: "date"; }; revoked: { type: "date"; required: false; }; rotatedAt: { type: "date"; required: false; }; rotationReplayResponse: { type: "string"; required: false; }; rotationReplayExpiresAt: { type: "date"; required: false; }; authTime: { type: "date"; required: false; }; confirmation: { type: "json"; required: false; }; scopes: { type: "string[]"; required: true; }; }; }; oauthAccessToken: { modelName: string; fields: { token: { type: "string"; unique: true; }; clientId: { type: "string"; required: true; references: { model: string; field: string; }; index: true; }; sessionId: { type: "string"; required: false; references: { model: string; field: string; onDelete: "set null"; }; index: true; }; userId: { type: "string"; required: false; references: { model: string; field: string; }; index: true; }; referenceId: { type: "string"; required: false; }; authorizationCodeId: { type: "string"; required: false; index: true; }; resources: { type: "string[]"; required: false; }; requestedUserInfoClaims: { type: "string[]"; required: false; }; refreshId: { type: "string"; required: false; references: { model: string; field: string; }; index: true; }; expiresAt: { type: "date"; }; createdAt: { type: "date"; }; revoked: { type: "date"; required: false; }; confirmation: { type: "json"; required: false; }; scopes: { type: "string[]"; required: true; }; }; }; oauthConsent: { modelName: string; fields: { clientId: { type: "string"; required: true; references: { model: string; field: string; }; index: true; }; userId: { type: "string"; required: false; references: { model: string; field: string; }; index: true; }; referenceId: { type: "string"; required: false; }; resources: { type: "string[]"; required: false; }; requestedUserInfoClaims: { type: "string[]"; required: false; }; scopes: { type: "string[]"; required: true; }; createdAt: { type: "date"; }; updatedAt: { type: "date"; }; }; }; oauthClientAssertion: { modelName: string; fields: { expiresAt: { type: "date"; required: true; }; }; }; }; rateLimit: ({ pathMatcher: (path: string) => path is "/oauth2/token"; window: number; max: number; } | { pathMatcher: (path: string) => path is "/oauth2/authorize"; window: number; max: number; } | { pathMatcher: (path: string) => path is "/oauth2/introspect"; window: number; max: number; } | { pathMatcher: (path: string) => path is "/oauth2/revoke"; window: number; max: number; } | { pathMatcher: (path: string) => path is "/oauth2/register"; window: number; max: number; } | { pathMatcher: (path: string) => path is "/oauth2/client/rotate-keys"; window: number; max: number; } | { pathMatcher: (path: string) => path is "/oauth2/userinfo"; window: number; max: number; })[]; }, better_auth_plugins0.DefaultOrganizationPlugin<{ schema: { invitation: { additionalFields: { authMethod: { type: "string"; required: false; }; }; }; organization: { additionalFields: { preferredAuthMethod: { type: "string"; input: true; required: false; }; serviceAccountUserId: { type: "string"; input: true; required: false; }; }; }; }; }>, { id: "device-authorization"; version: string; schema: { deviceCode: { fields: { deviceCode: { type: "string"; required: true; }; userCode: { type: "string"; required: true; }; userId: { type: "string"; required: false; }; expiresAt: { type: "date"; required: true; }; status: { type: "string"; required: true; }; lastPolledAt: { type: "date"; required: false; }; pollingInterval: { type: "number"; required: false; }; clientId: { type: "string"; required: false; }; scope: { type: "string"; required: false; }; }; indexes: { fields: [string]; unique: true; }[]; }; }; endpoints: { deviceCode: better_call0.StrictEndpoint<"/device/code", { method: "POST"; cloneRequest: true; body: zod0.ZodObject<{ client_id: zod0.ZodString; user_id: zod0.ZodOptional; scope: zod0.ZodOptional; }, zod_v4_core0.$strip> | zod0.ZodObject<{ user_id: zod0.ZodOptional; scope: zod0.ZodOptional; client_id: zod0.ZodOptional; }, zod_v4_core0.$strip>; error: zod0.ZodObject<{ error: zod0.ZodEnum<{ invalid_request: "invalid_request"; invalid_client: "invalid_client"; unauthorized_client: "unauthorized_client"; invalid_scope: "invalid_scope"; server_error: "server_error"; }>; error_description: zod0.ZodString; }, zod_v4_core0.$strip>; onValidationError: ({ issues, message }: { message: string; issues: readonly better_call0.StandardSchemaV1.Issue[]; }) => never; metadata: { noStore: boolean; allowedMediaTypes: string[]; openapi: { description: string; responses: { 200: { description: string; content: { "application/json": { schema: { type: "object"; properties: { device_code: { type: string; description: string; }; user_code: { type: string; description: string; }; verification_uri: { type: string; format: string; description: string; }; verification_uri_complete: { type: string; format: string; description: string; }; expires_in: { type: string; description: string; }; interval: { type: string; description: string; }; }; }; }; }; }; 400: { description: string; content: { "application/json": { schema: { type: "object"; properties: { error: { type: string; enum: ["invalid_request", "invalid_client", "unauthorized_client", "invalid_scope"]; }; error_description: { type: string; }; }; }; }; }; }; 500: { description: string; content: { "application/json": { schema: { type: "object"; properties: { error: { type: string; enum: string[]; }; error_description: { type: string; }; }; }; }; }; }; }; }; }; }, { device_code: string; user_code: string; verification_uri: string; verification_uri_complete: string; expires_in: number; interval: number; }>; deviceToken: better_call0.StrictEndpoint<"/device/token", { method: "POST"; body: zod0.ZodObject<{ grant_type: zod0.ZodLiteral<"urn:ietf:params:oauth:grant-type:device_code">; device_code: zod0.ZodString; client_id: zod0.ZodString; }, zod_v4_core0.$strip>; error: zod0.ZodObject<{ error: zod0.ZodEnum<{ invalid_request: "invalid_request"; invalid_client: "invalid_client"; authorization_pending: "authorization_pending"; slow_down: "slow_down"; expired_token: "expired_token"; access_denied: "access_denied"; invalid_grant: "invalid_grant"; }>; error_description: zod0.ZodString; }, zod_v4_core0.$strip>; metadata: { noStore: boolean; openapi: { description: string; responses: { 200: { description: string; content: { "application/json": { schema: { type: "object"; properties: { session: { $ref: string; }; user: { $ref: string; }; }; }; }; }; }; 400: { description: string; content: { "application/json": { schema: { type: "object"; properties: { error: { type: string; enum: string[]; }; error_description: { type: string; }; }; }; }; }; }; }; }; }; }, { access_token: string; token_type: string; expires_in: number; scope: string; }>; deviceVerify: better_call0.StrictEndpoint<"/device", { method: "GET"; query: zod0.ZodObject<{ user_code: zod0.ZodString; }, zod_v4_core0.$strip>; error: zod0.ZodObject<{ error: zod0.ZodEnum<{ invalid_request: "invalid_request"; }>; error_description: zod0.ZodString; }, zod_v4_core0.$strip>; metadata: { openapi: { description: string; responses: { 200: { description: string; content: { "application/json": { schema: { type: "object"; properties: { user_code: { type: string; description: string; }; status: { type: string; enum: string[]; description: string; }; client_id: { type: string; description: string; }; scope: { type: string; description: string; }; }; }; }; }; }; }; }; }; }, { user_code: string; status: string; client_id?: string | undefined; scope?: string | undefined; } & Partial>>; deviceApprove: better_call0.StrictEndpoint<"/device/approve", { method: "POST"; body: zod0.ZodObject<{ userCode: zod0.ZodString; }, zod_v4_core0.$strip>; error: zod0.ZodObject<{ error: zod0.ZodEnum<{ invalid_request: "invalid_request"; expired_token: "expired_token"; access_denied: "access_denied"; device_code_already_processed: "device_code_already_processed"; unauthorized: "unauthorized"; }>; error_description: zod0.ZodString; }, zod_v4_core0.$strip>; requireHeaders: true; metadata: { openapi: { description: string; responses: { 200: { description: string; content: { "application/json": { schema: { type: "object"; properties: { success: { type: string; }; }; }; }; }; }; }; }; }; }, { success: boolean; }>; deviceDeny: better_call0.StrictEndpoint<"/device/deny", { method: "POST"; body: zod0.ZodObject<{ userCode: zod0.ZodString; }, zod_v4_core0.$strip>; error: zod0.ZodObject<{ error: zod0.ZodEnum<{ invalid_request: "invalid_request"; expired_token: "expired_token"; access_denied: "access_denied"; unauthorized: "unauthorized"; }>; error_description: zod0.ZodString; }, zod_v4_core0.$strip>; requireHeaders: true; metadata: { openapi: { description: string; responses: { 200: { description: string; content: { "application/json": { schema: { type: "object"; properties: { success: { type: string; }; }; }; }; }; }; }; }; }; }, { success: boolean; }>; }; rateLimit: { pathMatcher(path: string): path is "/device"; window: number; max: number; }[]; $ERROR_CODES: { USER_NOT_FOUND: better_auth0.RawError<"USER_NOT_FOUND">; FAILED_TO_CREATE_SESSION: better_auth0.RawError<"FAILED_TO_CREATE_SESSION">; INVALID_DEVICE_CODE: better_auth0.RawError<"INVALID_DEVICE_CODE">; EXPIRED_DEVICE_CODE: better_auth0.RawError<"EXPIRED_DEVICE_CODE">; EXPIRED_USER_CODE: better_auth0.RawError<"EXPIRED_USER_CODE">; AUTHORIZATION_PENDING: better_auth0.RawError<"AUTHORIZATION_PENDING">; ACCESS_DENIED: better_auth0.RawError<"ACCESS_DENIED">; INVALID_USER_CODE: better_auth0.RawError<"INVALID_USER_CODE">; DEVICE_CODE_ALREADY_PROCESSED: better_auth0.RawError<"DEVICE_CODE_ALREADY_PROCESSED">; DEVICE_CODE_NOT_CLAIMED: better_auth0.RawError<"DEVICE_CODE_NOT_CLAIMED">; POLLING_TOO_FREQUENTLY: better_auth0.RawError<"POLLING_TOO_FREQUENTLY">; INVALID_DEVICE_CODE_STATUS: better_auth0.RawError<"INVALID_DEVICE_CODE_STATUS">; AUTHENTICATION_REQUIRED: better_auth0.RawError<"AUTHENTICATION_REQUIRED">; }; options: { grant: better_auth_plugins0.DeviceAuthorizationGrant>; }>, Record> | undefined; expiresIn: better_auth_plugins0.TimeString; interval: better_auth_plugins0.TimeString; deviceCodeLength: number; userCodeLength: number; generateDeviceCode?: (() => string | Promise) | undefined; generateUserCode?: (() => string | Promise) | undefined; validateClient?: ((clientId: string) => boolean | Promise) | undefined; onDeviceAuthRequest?: ((clientId: string, scope: string | undefined) => void | Promise) | undefined; verificationUri?: string | undefined; schema?: { deviceCode?: { modelName?: string | undefined; fields?: { deviceCode?: string | undefined; userCode?: string | undefined; userId?: string | undefined; expiresAt?: string | undefined; status?: string | undefined; lastPolledAt?: string | undefined; pollingInterval?: string | undefined; clientId?: string | undefined; scope?: string | undefined; } | undefined; } | undefined; } | undefined; }; }]; }>; type AuthInstance = ReturnType; declare function createAuth(config: BetterAuthConfig): AuthInstance; declare const auth: AuthInstance; //#endregion export { type BetterAuthConfig, type EmailServiceConfig, type OIDCProviderConfig, type SAMLProviderConfig, type SSOProviderConfig, type UserAuthConfig, auth, createAuth, extractCookieDomain, hasCredentialAccount };