Exchange an ID token
Pass access_token when the provider ID token contains an at_hash claim. Pass nonce when the token contains a nonce claim.
const result = await client.auth.signInWithIdToken({ provider: 'google', token: providerIdToken, access_token: providerAccessToken, nonce}) if (result.error) { throw result.error} console.log(result.data.user)console.log(result.data.session)Supported providers
Supported provider identifiers are Apple, Azure, Discord, GitHub, GitLab, Google, Snapchat, Twitch, Twitter, and X.
Exchange a PKCE code
When the client is configured with flowType set to pkce, exchange the authorization code returned to the callback URL.
const result = await client.auth.exchangeCodeForSession(authCode) if (result.error) { throw result.error} console.log(result.data.user)console.log(result.data.session)