This package adds all needed files to add OAuth/Supabase Authentication to your Sveltekit project (See Below for Create-Svelte to create your project if you do not already have it created).
Everything you need to build a Svelte project, powered by create-svelte
.
If you're seeing this, you've probably already done this step. Congrats!
npm create svelte@latest
or
or
npm create svelte@latest my-app
or
npm create svelte@latest .
I am a fan of TailwindCSS and DaisyUI but if you want other options click here to see them.
So I use the below command to install my preferences.
npx svelte-add@latest tailwindcss --tailwindcss-forms --tailwindcss-typography --tailwindcss-daisyui
or
npx svelte-add@latest tailwindcss --tailwindcss-daisyui
Once you've created a project and installed dependencies with npm install
(or pnpm install
or yarn
), 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.
npx install sveltekit-oauth-supabase-auth
npm i
or
npx add sveltekit-oauth-supabase-auth
npm i
# ./example.env
# Supabase Database URL
DATABASE_URL=your_database_url
# Supabase URL and Key
PUBLIC_SUPABASE_URL=your_supabase_url
PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
# OAuth Auth Secret Key that you will need to provide here. Once it is set, it should not be changed.
AUTH_SECRET=your_auth_secret
# Github OAuth Keys
VITE_GITHUB_ID=your_github_id
VITE_GITHUB_SECRET=your_github_secret
# Google OAuth Keys
VITE_GOOGLE_CLIENT_ID=your_google_client_id
VITE_GOOGLE_CLIENT_SECRET=your_google_client_secret