apps/docs/content/guides/auth/social-login/auth-twitch.mdx
To enable Twitch Auth for your project, you need to set up a Twitch Application and add the Application OAuth credentials to your Supabase Dashboard.
Setting up Twitch logins for your application consists of 3 parts:
Log in with Twitch at the top right to log in.<$Partial path="social_provider_setup.mdx" variables={{ "provider": "Twitch" }} />
+ Register Your Application at the top right.OAuth Redirect URL (the callback URL from the previous step.)Create.Manage at the right of your application entry in the list.New Secret to create a new Client Secret.<$Partial path="social_provider_settings_supabase.mdx" variables={{ "provider": "Twitch" }} />
<Tabs scrollable size="small" type="underlined" defaultActiveId="js" queryGroup="language"
<TabPanel id="js" label="JavaScript">
<$Partial path="create_client_snippet.mdx" />
When your user signs in, call signInWithOAuth() with twitch as the provider:
import { createClient } from '@supabase/supabase-js'
const supabase = createClient('<your-project-url>', '<sb_publishable_... or anon key>')
// ---cut---
async function signInWithTwitch() {
const { data, error } = await supabase.auth.signInWithOAuth({
provider: 'twitch',
})
}
When your user signs in, call signInWithOAuth() with twitch as the provider:
Future<void> signInWithTwitch() async {
await supabase.auth.signInWithOAuth(
OAuthProvider.twitch,
redirectTo: kIsWeb ? null : 'my.scheme://my-host', // Optionally set the redirect link to bring back the user via deeplink.
authScreenLaunchMode:
kIsWeb ? LaunchMode.platformDefault : LaunchMode.externalApplication, // Launch the auth screen in a new webview on mobile.
);
}
When your user signs in, call signInWith(Provider) with Twitch as the Provider:
suspend fun signInWithTwitch() {
supabase.auth.signInWith(Twitch)
}
<$Partial path="oauth_pkce_flow.mdx" />
<Tabs scrollable size="small" type="underlined" defaultActiveId="js" queryGroup="language"
<TabPanel id="js" label="JavaScript">
When your user signs out, call signOut() to remove them from the browser session and any objects from localStorage:
import { createClient } from '@supabase/supabase-js'
const supabase = createClient('<your-project-url>', '<sb_publishable_... or anon key>')
// ---cut---
async function signOut() {
const { error } = await supabase.auth.signOut()
}
When your user signs out, call signOut() to remove them from the browser session and any objects from localStorage:
Future<void> signOut() async {
await supabase.auth.signOut();
}
When your user signs out, call signOut() to remove them from the browser session and any objects from localStorage:
suspend fun signOut() {
supabase.auth.signOut()
}