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
Socal
Socal2y ago
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
AceroAlCarbono
AceroAlCarbonoOP2y ago
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?
Socal
Socal2y ago
no, i'm currently using cloudflare it has a sveltekit adapter and it's pretty easy to setup
AceroAlCarbono
AceroAlCarbonoOP2y ago
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).
Socal
Socal2y ago
cloudflare is free. you use pages and they have generous free plans
Socal
Socal2y ago
SvelteKit docs
Cloudflare Pages • SvelteKit documentation
Socal
Socal2y ago
Cloudflare
Cloudflare Developer Platform Product Offering | Cloudflare
The Cloudflare Developer Platform product offering has everything you need to deliver serverless applications.
AceroAlCarbono
AceroAlCarbonoOP2y ago
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.
Socal
Socal2y ago
that would probably fit in their free tier the next step up is $5/mth

Did you find this page helpful?