Sign in a user through OAuth
Log in an existing user via a third-party provider. This method supports the PKCE flow.
- This method is used for signing in using a third-party provider.
- Supabase supports many different third-party providers.
Parameters
- credentialsREQUIREDSignInWithOAuthCredentialsproviderREQUIREDProvider
One of the providers supported by GoTrue.
optionsOptionalobjectqueryParamsOptionalobjectAn object of query params
redirectToOptionalstringA URL to send the user to after they are confirmed.
scopesOptionalstringA space-separated list of scopes granted to the OAuth application.
skipBrowserRedirectOptionalbooleanIf set to true does not immediately redirect the current browser context to visit the OAuth authorization page for the provider.
const { data, error } = await supabase.auth.signInWithOAuth({
provider: 'github'
})