Documentation navigation
← Back to Jupiter Auth

ID Token Sign-in

Exchange an ID token issued by a supported identity provider for a Jupiter session.

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

The SDK explicitly supports Google, Apple, Azure, Facebook, and Kakao provider identifiers. Custom OIDC providers use custom:<provider-name>.

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)