Easiest way to link my Sveltekit frontend to by Supabase Backend?
I have been developing locally the frontend for my webapp in Sveltekit. Now I need some Auth and Database functions so I'm using Supabase for the backend. What's the easiest way to link my Sveltekit project to my Supabase Backend? Is there any intuitive/integrated way, or I can only host the frontend in a different host, then use endpoints?
10 Replies
Creating a Supabase client for SSR | Supabase Docs
Configure Supabase client to use Cookies
this is the best way to setup supabase in your sveltekit environment. sveltekit is both client side and server.
supabase is a database and has rest endpoints via postgrest. you want your user authenticated to make calls to the postgrest endpoints, you use supabase-js
Thank you. And what about the frontend hosting, can that be hosted on Supabase itself (Firebase for example has Firebase Hosting), or do I have to host is elsewhere?
no, i'm currently using cloudflare
it has a sveltekit adapter and it's pretty easy to setup
Which cloudfare service specifically? I can't seem to find a webhosting service in their webpage.
Also, what about Vercel? It seems pretty powerful for frontend applications, and it has an integration into Supabase. But it's very expensive (20 USD per month), compared to other hosts like Hostinger (like 10 USD a year for a basic plan).
cloudflare is free. you use pages and they have generous free plans
SvelteKit docs
Cloudflare Pages • SvelteKit documentation
Cloudflare
Cloudflare Developer Platform Product Offering | Cloudflare
The Cloudflare Developer Platform product offering has everything you need to deliver serverless applications.
Much appreciated.
Is it too expensive to scale cloudfare? I'm expecting to have about 100 daily users in the mid term. For 2 or 3 custom domains.
that would probably fit in their free tier
the next step up is $5/mth