Start a provider sign-in
In a browser, signInWithSocial redirects automatically unless skipBrowserRedirect is true.
const result = await client.auth.signInWithSocial({ provider: 'github', options: { redirectTo: 'https://app.example.com/auth/callback', scopes: 'read:user user:email' }}) if (result.error) { throw result.error}Handle navigation yourself
Set skipBrowserRedirect when the application needs to handle navigation itself. The returned URL is the provider authorization URL.
const result = await client.auth.signInWithSocial({ provider: 'google', options: { redirectTo: 'https://app.example.com/auth/callback', skipBrowserRedirect: true }}) if (result.error) { throw result.error} if (result.data.url) { window.location.assign(result.data.url)}Supported providers
- Apple, Azure, Bitbucket, Discord, Facebook, Figma, GitHub, GitLab, Google
- Kakao, Keycloak, LinkedIn, LinkedIn OIDC, Notion, Slack, Slack OIDC
- Spotify, Twitch, Twitter, X, WorkOS, Zoom, and Fly
- Custom OIDC providers using custom:<provider-name>
Build an authorization URL
getAuthorizeUrl builds a provider authorization URL without navigating the browser.
const authorizationUrl = client.auth.getAuthorizeUrl({ provider: 'github', redirectTo: 'https://app.example.com/auth/callback', scopes: 'read:user user:email'})