Sveltekit Supabase Demo screenshot

Sveltekit Supabase Demo

Author Avatar Theme by Ashleyconnor
Updated: 11 Sep 2021
39 Stars

Demo application using SvelteKit, Supabase and Cloudflare Workers

Categories

Overview

The sveltekit-supabase-demo repository demonstrates how to integrate Supabase with SvelteKit. It provides instructions on creating a .env file, creating tables in Supabase, setting up OAuth integration with Github and Twitter, and making authenticated calls to Supabase within endpoints. The article also discusses potential improvements for Supabase Auth.

Features

  • Integration of Supabase with SvelteKit
  • Creation of tables in Supabase
  • OAuth integration with Github and Twitter
  • Making authenticated calls to Supabase within endpoints
  • Discussion of potential improvements for Supabase Auth

Installation

To install the theme, follow these steps:

  1. Create a .env file in the project directory and add your Supabase URL and public token.
  2. Create tables in Supabase by signing up for a Supabase account and running the provided script in the SQL tab of a new project.
  3. Set up OAuth integration with Github and Twitter by following the documentation provided.
  4. To make authenticated calls to Supabase within endpoints, use the auth.onAuthStateChange() callback and the setAuthCookie function in the hooks.js file.

Summary

The sveltekit-supabase-demo repository provides a demonstration of integrating Supabase with SvelteKit. It guides users through the process of setting up the necessary configurations and demonstrates how to make authenticated calls to Supabase within endpoints. The article also suggests potential improvements for Supabase Auth, such as allowing configuration of the refresh endpoint and providing a function to generate the cookie using just the token.