apps/docs/content/guides/auth/social-login/auth-figma.mdx
To enable Figma Auth for your project, you need to set up a Figma OAuth application and add the application credentials to your Supabase Dashboard.
Setting up Figma logins for your application consists of 3 parts:
client_id and client_secret to your Supabase Project.<$Partial path="social_provider_setup.mdx" variables={{ "provider": "Figma" }} />
Enter your App name, select the owner for the app and click Create app button
Copy and save your newly-generated Client ID
Copy and save your newly-generated Client Secret
Then, go to OAuth credentials and click on Add a redirect URL button
Add your URL from the previous step (callback URL on Supabase) and click on Add button
Go to OAuth scopes and select current_user:read under Users.
<$Partial path="social_provider_settings_supabase.mdx" variables={{ "provider": "Figma" }} />
<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 figma as the provider:
import { createClient } from '@supabase/supabase-js'
const supabase = createClient('<your-project-url>', '<sb_publishable_... or anon key>')
// ---cut---
async function signInWithFigma() {
const { data, error } = await supabase.auth.signInWithOAuth({
provider: 'figma',
})
}
When your user signs in, call signInWithOAuth() with figma as the provider:
Future<void> signInWithFigma() async {
await supabase.auth.signInWithOAuth(
OAuthProvider.figma,
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 Figma as the Provider:
suspend fun signInWithFigma() {
supabase.auth.signInWith(Figma)
}
<$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()
}