import type { OAuthProvider } from "./interfaces"; export interface GoogleUserInfo { googleId: string; email: string; displayName: string | null; photoUrl: string | null; emailVerified: boolean; } export interface GoogleProviderConfig { clientId: string; /** * The OAuth 2.0 client secret from Google Cloud Console. * * Required for the **authorization code flow** (Path 3), where the * frontend sends an authorization `code` and the backend exchanges it * server-side for tokens. This is the most secure flow because tokens * never touch the browser. * * When omitted, only ID-token and access-token verification are available * (Paths 1 & 2), which rely on the frontend obtaining tokens directly. */ clientSecret?: string; } /** * Creates a Google OAuth Provider integration. * * Supports three verification paths: * * **Path 1 – ID Token** (One Tap / Sign In With Google button): * Frontend sends `idToken`. Backend verifies cryptographically using * Google's public keys. No secret required. * * **Path 2 – Access Token** (popup via `initTokenClient`): * Frontend sends `accessToken`. Backend validates by calling Google's * userinfo endpoint. No secret required. * * **Path 3 – Authorization Code** (most secure, requires `clientSecret`): * Frontend sends `code` + `redirectUri`. Backend exchanges the code * server-side for an ID token using `clientId` + `clientSecret`, then * verifies the ID token. Tokens never touch the browser. */ export declare function createGoogleProvider(config: GoogleProviderConfig | string): OAuthProvider<{ idToken?: string; accessToken?: string; code?: string; redirectUri?: string; }>;