List identities
getUserIdentities returns the external identities attached to the current authenticated user.
const { data, error } = await client.auth.getUserIdentities() console.log(data?.identities)Link an OAuth identity
linkIdentity starts an OAuth authorization flow for the current authenticated user. In the browser, it navigates automatically unless skipBrowserRedirect is enabled.
const { data, error } = await client.auth.linkIdentity({ provider: 'google', options: { redirectTo: 'https://app.example.com/auth/callback' }})Link an OIDC identity token
Pass an external provider ID token to linkIdentity to attach that identity directly to the current user.
const { data, error } = await client.auth.linkIdentity({ provider: 'google', token: providerIdToken, access_token: providerAccessToken, nonce})Unlink an identity
unlinkIdentity removes one PublicIdentity from the current user. Pass the identity object returned by getUserIdentities.
const { data: identitiesData } = await client.auth.getUserIdentities() const identity = identitiesData?.identities[0] if (identity) { await client.auth.unlinkIdentity(identity)}