All Questions
60
questions
14
votes
1
answer
7k
views
How can I send secure API requests from SvelteKit app, without showing API keys on the client side?
I'm using Supabase for a new Sveltekit app, with this template
Currently, I'm passing the Supabase keys through on the client side, like this:
const supabase = createClient(
import.meta.env....
5
votes
2
answers
2k
views
How to pass in parameters from client side to server side code in Sveltekit?
I've been trying to run a query to a Supabase database that needs a dog breed passed through and will return metrics about it, the breed is defined on the client side. I was able to get the server ...
4
votes
1
answer
2k
views
Cannot destructure property 'supabaseUrl' of 'getConfig(...)' as it is undefined
I followed @supabase/auth-helpers-sveltekit guide on how to integrate supabase-auth helpers with sveltekit.
Yet, when running the dev server, I get an internal error
Cannot destructure property '...
4
votes
2
answers
1k
views
Sveltekit,Supabase and Vercel (problem with Supabase when deploying to Vercel)
I'm trying to set up Sveltekit, Supabase and Vercel.
It works correctly on a local environment (SvelteKit and Supabase), but when I deploy it to Vercel there is a problem with Supabase - "Error: ...
4
votes
1
answer
2k
views
supabaseUrl is required sveltekit
I'm having this problem for quite a while and want to solve this:
According to supbase documentation you create a .env file
VITE_SUPABASE_URL="YOUR_SUPABASE_URL"
VITE_SUPABASE_ANON_KEY="...
4
votes
1
answer
3k
views
Error when trying to call a supabase edge function
I am trying to call a supabase edge function in javascript but I am getting this error:
access to fetch at 'https:/blablala.functions.supabase.co/hello-world' from origin 'http://localhost:5173' has ...
3
votes
1
answer
395
views
Dynamic social sharing cards populated in <svelte:head>
I've built a blog website and am trying to implement dynamic social share cards for each individual blog. While everything appears to be working properly when I inspect the head element in developer ...
3
votes
3
answers
1k
views
How to implement cookie authentication with Sveltekit & Supabase?
I'm fairly new to both SvelteKit & Supabase and have done a bit of experimentation on my own, but I would like to know what is the best way to implement user authentication with both of these ...
2
votes
1
answer
2k
views
How to check if a user is signed in with Supabase in SvelteKit?
I am working on a SvelteKit application and using Supabase for user authentication. I have implemented the sign-in functionality in my /signin/+page.server.ts file using the supabase.auth....
2
votes
2
answers
2k
views
Is there a way to remove previous session without hard refreshing (sveltekit and Supabase)
im practicing authentication at the moment with sveltekit and Supabase
RLS is on and one of the issues im having is after i log out, and i sign in with another email, i can see the info from the ...
2
votes
1
answer
846
views
Use Supabase .select with Sveltekit store
if in my current .svelte file i have
let todos = [];
onMount(async () => {
let { data, error } = await supabase .from('todos') .select('*')
todos = data;
however i don't think that's pretty ...
2
votes
1
answer
1k
views
Typescript error with SvelteKit and Supabase data fetching (Type 'null' is not assignable to type 'ArrayLike<unknown>')
I have a SvelteKit project set up which authenticates with supabase. I used this guide for that. The authentication and data fetching works fine so far. Actually, in terms of the app itself, ...
2
votes
1
answer
223
views
supabase auth helpers ui with Google social login, how to restrict users to domain
Google offer a 'hd' parameter to restrict oauth access to domain. Anyway to set this when using supabase auth helpers / auth UI?
2
votes
1
answer
2k
views
Sveltekit update reactive variable from form action
Hi!
So I'm working on a simple crud application with Sveltekit and Supabase. I'm trying to implement this sorting feature by fetching the table with the added .order() function when the user selects a ...
2
votes
2
answers
1k
views
SvelteKit + Supabase - get data onMount, keep pre-fetch working
I am building the site which seems fairly simple show data on page from database.
I want it to be as fast as possible. It already works/partially works in 3 ways:
#Approach 1
+page.server.js -> ...
2
votes
0
answers
3k
views
Why is supabase update not working for me?
I am trying to update a user's name in the profiles table. This command works when i disable rls on the table but not when it is on. When the function is called the error is null, data is just an ...
2
votes
2
answers
436
views
Pass a value from an api into an object as to insert a new row into the database
Using type=radio along with bind:group as shown in my example this will add the row to the database, but it only works for 1 entry plus the user needs to check the radio. Staring with just adding 1 ...
1
vote
1
answer
3k
views
Supabase StorageApiError: The resource was not found
I'm trying to download a PDF file from a bucket from a SvelteKit endpoint.
The file is there (I logged filePath and bucketName to the console and checked them against my actual bucket), and I think ...
1
vote
1
answer
459
views
Supabase & SvelteKit Auth Error when registering a new user "PKCE flow"
Whenever I try to register a new account I get the following error on my container:
PKCE flow is not supported on signups with autoconfirm enabled
1
vote
1
answer
248
views
Why does Typescript throw an error when I try to create Supabase client file?
I am quite new to SvelteKit and Typescript and I've recently tried uisng Supabase with SvelteKit (Typescript) and it all went well unil all of a sudden, after few projects Typescript began compalining ...
1
vote
1
answer
672
views
Internal server error: supabaseUrl is required. (Vite and Sveltekit)
I've been trying to add environment variables to my db.js file which connects to a Supabase database. When I pass the URL and key as a string it works perfectly but when I try to add environment ...
1
vote
1
answer
555
views
SvelteKit/Supabase Type 'Session | null' is not assignable to type 'Session'
tl:dr
This is the error I'm getting in VS Code:
let session: AuthSession
Type 'Session | null' is not assignable to type 'Session'.
Type 'null' is not assignable to type 'Session'.ts(2322)
...
1
vote
3
answers
538
views
Make DOM live update with SvelteKit and Supabase
I am using SvelteKit with Supabase. Whenever the form is submitted I would like to see the DOM live update. However, it takes a refresh to see the changes.
How would I live update the DOM whenever a ...
1
vote
1
answer
2k
views
When deploying Sveltekit app to Netlify, build breaks with error '@supabase/supabase-js' does not provide an export named 'createClient'. How to fix?
When I try to deploy a SvelteKit app with supabase to Netlify (using adapter-netlify), the Netlify build fails with the following error:
requested module '@supabase/supabase-js' does not provide an ...
1
vote
0
answers
28
views
How can I display unique data associated with param on individual pages in SvelteKit using slug/parameter routing
I'm currently working on a SvelteKit project where I have a list of cards representing different law firms. Each card is linked to a unique page using slug/parameter routing. I've managed to fetch the ...
1
vote
1
answer
34
views
supabase auth ui not redirecting after successful sign in
I have followed: https://supabase.com/docs/guides/getting-started/tutorials/with-sveltekit?language=ts and verified that everything runs correctly and all files are in the right place/have the correct ...
1
vote
2
answers
335
views
Supabase auth not storing anything in cookies sveltekit
I am trying to build a simple supabase application, I have followed the documentation for the "auth" section exactly, as far as I can tell. Currently, I am generating a magic link, getting a ...
1
vote
1
answer
400
views
How to fetch data from Component with Supabase & Auth Helpers Sveltekit
I have an input inside a component in Svelte. It is part of series of steps using svelte-stepper. I need the user to enter their organizationID into an input field and then I want to see if that value ...
1
vote
0
answers
176
views
Cannot Delpoy Sveltekit app with Supabase From netlify
So i have a app with Sveltekit tailwindcss skeleton ui and supabase, i have tried to deploy from vercel and netlify but neither of them have been working!
Error:
import {
7:49:34 AM: 3: ...
1
vote
0
answers
555
views
How to user a svelte store variable in an endpoint?
Im using supabase for my back end and in my end point i want to fetch data for the user that is logged in via the .eq method.
I have a user variable in my store however
I keep getting errors because i ...
1
vote
0
answers
219
views
svelte and supabase endpoints
For supabase and sveltekit. which is better for fetching the data.
using the stores or using endpoints?
im trying to understand why the endpoints are so important. besides lessing down on the boiler ...
0
votes
1
answer
621
views
supabase auth-helpers with auth-ui, how to hide email/password when using social
When setting social login, there doesn't seem to be a way to hide the email/password boxes.
<Auth
supabaseClient={data.supabase}
view="sign_in"
...
0
votes
1
answer
109
views
SvelteKit supabaseUrl is required - after successful deployment
I keep getting this error after I deploy my app with npm run preview and when I deploy through Vercel. I get no error when the app is "building"
The problem isn't the .env variables being ...
0
votes
1
answer
1k
views
how to append forms based on input with svelte
can someone help me understand this please.
I want when someone enters a number, that 2 forms appear and the data from those forms would go into a new object that i can push to supabase
for example
...
0
votes
1
answer
11
views
Supabase table not being updated through Sveltekit App
I've successfully fetched the information (from supabase) and it's being displayed on the page - with functionality that includes an "Edit" button.
The "Edit" button is allowing me ...
0
votes
1
answer
29
views
How do I display Supabase AuthApiError from server-side in client -side
I am working on a SvelteKit application with a Supabase back-end. I just finished on input validation, and now I am trying to display errors for invalid credentials. I am struggling find a way to do ...
0
votes
0
answers
62
views
How to get email confirmation to work on Supabase local development environment
I working on authentication on a Supabase and SvelteKit project. I have setup the authentication client and Signup works fine, but the email confirmation is causing problems. I am running a local ...
0
votes
0
answers
44
views
With Supabase and SvelteKit, I'm getting an empty array with RLS even with policy
I have a client table an want to allow the users to see only the clients they created.
I enabled RLS and created a policy, but I'm getting an empty array when querying the data.
In Supabase Studio, ...
0
votes
0
answers
35
views
Deploy Svelte and Supabase to Google cloud and supabase is unable to get the environment variables
What I expected to happen
I’m trying to use gcloud command line to deploy and sveltekit web app with supabase. I expected the build to complete successfully and be able to host my app on google cloud.
...
0
votes
0
answers
30
views
Incompatible types error in TypeScript that I don't understand
I just started learning TypeScript and SvelteKit and I came across this error today:
Type '{ id: any; user_id: any; video_id: any; question: any; created_at: any; response: any; state: any; users: { ...
0
votes
0
answers
56
views
supabase retrieve access token on server side
anyone know how to retrieve the access token when you click "send password recovery"?
the redirect_url looks something like this: http://localhost:5173/#access_token=eyJhbG...&token_type=...
0
votes
0
answers
20
views
POST request going through before having post validation
I'm using Sveltekit as the framework paired with supabase and have installed a sveltekit form validator. Im pretty new to back end stuff and have just crammed code that I've read online trying tp ...
0
votes
0
answers
25
views
Supabase Client Unresponsive in SvelteKit When User is Signed In and Website Loses Focus
I am facing an issue with SvelteKit and Supabase integration. When there is no user signed in, the Supabase client works as expected, even when the website loses focus or I change the browser tab. ...
0
votes
1
answer
203
views
message: 'TypeError: fetch failed' - SvelteKit + Supabase
I am creating a Sveltekit project and decided to use Supabase as my database.
src/lib/supabaseClient.js
import { createClient } from '@supabase/supabase-js'
import {SUPABASE_URL, SUPABASE_KEY} from '$...
0
votes
0
answers
126
views
How to fix 405 error code from displaying before auth comes back from supabase
I am using Supabase to handle auth in my Sveltekit app. When user logs in with proper credentials after they have signed up, I am getting a quick flash onscreen that says 405 POST method not allowed. ...
0
votes
0
answers
309
views
SvelteKit + Supabase OAuth Redirect Issue
I'm currently learning SvelteKit and Supabase + Supabase authentication. I'm using Google OAuth for user login, following the tutorial from here. When a user logs in with the Google provider, I ...
0
votes
0
answers
390
views
Supabase function not returning data when called from Svelte app
I've got the following Supabase function:
CREATE OR REPLACE FUNCTION public.file_exists(file_path varchar)
RETURNS boolean
LANGUAGE plpgsql
AS $$
BEGIN
RETURN
(SELECT EXISTS
(SELECT id
...
0
votes
0
answers
120
views
How to avoid a waterfall in a SvelteKit api +server.js file?
Is it possible to avoid making a water fall of these 2 calls to Supabase? It would be awesome to load the data in parallell.
export async function POST({ request }) {
const reqData = await request....
0
votes
0
answers
374
views
Combining Steam OpenID 2.0 with Supabase auth
So I'm currently using the node-steam-openid package in my SvelteKit app in order to allow users to Sign in with Steam. This works fine, and it returns the user's steam_id on the server side.
However, ...
0
votes
0
answers
288
views
How to access session data in a POST request within Sveltekit
Specifically, I wish to insert a record into a Supabase table by an authenticated user.
Retrieving data by an authenticated user works fine:
export const load = async ({ params, locals: { supabase, ...