Supabase Authentication Setup
Supabase is an open-source Firebase alternative that provides authentication, database, and storage services. This guide shows you how to integrate Supabase authentication with your Dev Portal documentation site.
Prerequisites
You'll need a Supabase project. If you don't have one, create a free Supabase project to get started.
Setup Steps
-
Configure Authentication Provider
In your Supabase Dashboard:
- Navigate to Authentication → Providers
- Enable your preferred authentication provider (GitHub, Google, Azure, etc.)
- Configure the provider settings:
- Redirect URL:
https://your-project.supabase.co/auth/v1/callback - Copy any required credentials (Client ID, Client Secret) from the provider
- Redirect URL:
-
Get Your Project Credentials
From your Supabase project dashboard:
- Go to Settings → Data API
- Copy your Project URL (looks like
https://your-project.supabase.co) - Go to Settings → API Keys
- Copy your anon public API key
-
Configure Zudoku
Add the Supabase configuration to your Dev Portal configuration file:
Code
Supported Providers
Supabase supports numerous authentication providers. Use any of these values for the provider
field:
apple- Sign in with Appleazure- Microsoft Azure ADbitbucket- Bitbucketdiscord- Discordfacebook- Facebookfigma- Figmagithub- GitHubgitlab- GitLabgoogle- Googlekakao- Kakaokeycloak- Keycloaklinkedin/linkedin_oidc- LinkedInnotion- Notionslack/slack_oidc- Slackspotify- Spotifytwitch- Twitchtwitter- Twitter/Xworkos- WorkOSzoom- Zoomfly- Fly.io
Email does not need to be specified as a provider because it is enabled by default in Supabase.
Configuration Options
Redirect Configuration
Customize redirect behavior after authentication events:
Code
Advanced Configuration
Custom User Metadata
Store additional user information in Supabase:
- Create a
profilestable in your Supabase database - Set up a trigger to create profile records on user signup
- Access this data in your application as needed
Troubleshooting
Common Issues
-
Invalid API Key: Ensure you're using the
anon publickey, not theservice_rolekey. -
Provider Not Working: Verify the provider is enabled in your Supabase dashboard and properly configured with the correct redirect URLs.
-
Redirect URLs: For local development, update your redirect URLs in both Supabase and the OAuth provider to include
http://localhost:3000. -
CORS Errors: Check that your site's domain is properly configured in Supabase's allowed URLs.
Next Steps
- Explore Supabase Auth documentation for advanced features
- Learn about protecting routes in your documentation