A minimal template for building Svelte5 applications with Supabase integration, including generic pages for /login and /account and OAuth login via Google or GitHub.
.env.example to .env and paste in your SUPABASE_URL and SUPABASE_ANON_KEY from the projectnpm install
This template includes OAuth support for Google and GitHub authentication.
Setting up OAuth involves two parts that work together:
I recommend doing these side-by-side to make copy-pasting the credentials and callback URL easier.
Authentication -> Sign In / UpAuth Providers and select your desired providerCallback URL provided by Supabase (you'll need this for your OAuth provider)External as audience)Web applicationAuthorized redirect URIs in your Google Cloud ConsoleClient ID and Client Secret to use in SupabaseFor more information check Googles documentation and the Supabase Login with Google guide
Homepage URL. You can use http://localhost:3000/ if you are just not hosting it. Device flow is not needed.Authorization callback URL fieldClient ID and generate a Client Secret to use in SupabaseFor more information check GitHubs documentation and the Supabase Login with GitHub guide
The process is similar for other providers Supabase supports:
Check the Supabase Social Login documentation for additional information
Once you've completed the setup, you can start a development server:
npm run dev
or start the server and open the app in a new browser tab
npm run dev -- --open
To create a production version of your app:
npm run build
You can preview the production build with npm run preview.
To deploy your app, you may need to install an adapter for your target environment.
The easiest way to deploy this app is to use the Vercel Platform.
When deploying to Vercel, make sure to:
This template was created using npx sv create with the following options: