Questions tagged [supabase-js]

For questions related to Supabase JS client. Consider also using the tag [supabase], if necessary.

93 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
4 votes
2 answers
3k views

Supabase "TypeError: fetch failed"

I am making a to-do list application with Supabase and NextJS-13 and while fetching the lists from Supabase, the server gave me this error Error Image My List table on Supabase has three columns: id ...
Vaibhav Jain's user avatar
3 votes
0 answers
342 views

ReferenceError: window is not defined in React Native project after adding Supabase call

I'm using a React Native project with Expo v49, and I added a Supabase call to read some data from the database, and it works on ios/android, But when I open the web version, I get "...
shadowcrux's user avatar
3 votes
0 answers
390 views

Supabase SELECT with function call

From Javascript, I want to call a function in my supabase select statement (funcition name is id_encode in this example): const { data, error } = await supabase .from('table') .select(&...
Alan's user avatar
  • 53
3 votes
2 answers
434 views

Supabase Realtime detecting duplicates for the same event

I have a simple page where I'm inserting a message into a message table and then on the frontend detecting it. I have used the sample code provided. However, everytime, I seem to be detecting 3 events ...
Saumil Shah's user avatar
  • 1,433
2 votes
1 answer
949 views

Nextjs 13 Supbase auth redirect post social login not working properly

I am having some trouble getting Supabase auth working properly in NextJS 13. I would like some pages to be protected and if the user navigates to those pages, they should first be redirected to the ...
adeelmahmood's user avatar
  • 2,401
2 votes
3 answers
746 views

react native supabase auth with google redirect issue & no session update

I am a little confused about trying to make a redirect URL to go along with the openAuthSessionAsync in app mobile browser view (docs: https://docs.expo.dev/versions/latest/sdk/webbrowser/#...
Phil Lucks's user avatar
  • 3,476
2 votes
0 answers
276 views

How can I get the image that OpenAI API returns and upload it to Supabase Storage?

I tried using the URL that is returned by default but there is a CORS issue on OpenAI's end which won't allow me to use fetch. So now I am trying to use b64_json but I cannot figure out how to get ...
Globe's user avatar
  • 179
1 vote
1 answer
45 views

500 SupabaseUrl is required error when deployed on Netlify

I developed an application using NuxtJs3 + supabase. I am using the @nuxtjs/supabase module as well. On my local dev things are working fine but when I deployed this on Netlify, I had the below error- ...
Neha Soni's user avatar
  • 4,317
1 vote
1 answer
345 views

Supabase & NodeJS: Invalid claim: AuthApiError: invalid claim: missing sub claim with getUser(jwt)

I have a custom backend that needs to authenticate users before letting them request some Express endpoints. It works that way: NextJS (front-end) sends a request to NodeJS/Express (backend) with a ...
Alexis's user avatar
  • 57
1 vote
0 answers
190 views

supabase.auth.signInWithOAuth is returning an URL with #

I'm using ExpressJS and Supabase Auth to create a Sign In with Google Button. So, after a user click on a button, it will be redirect to the route "/login/google" and their, will be redirect ...
Roberto Valente's user avatar
1 vote
1 answer
219 views

How to Dynamically Add Metadata to JWT Tokens in Supabase for Same User when signing in from Different Platforms

I am working on a project with two platforms, a Mobile App and an Admin App, both using Supabase for user authentication. I want to control data access for users based on the platform they are signed ...
Mohammed Yasin Mulla's user avatar
1 vote
0 answers
36 views

Supabase auth state lags behind when used in Root Layout (Next.js App router)

I've encountered an unusual behavior in my Next.js app (latest version, using App Router) integrated with Supabase Auth. I'm leveraging the Supabase auth state to conditionally render login/logout ...
octavemirbeau's user avatar
1 vote
1 answer
192 views

What is causing the error Cannot find name 'useSupabaseClient'. when using Nuxt 3 and Supabase?

Using npm I have installed Nuxt 3 and Supabase but in vs code I keep getting the following error; Cannot find name 'useSupabaseClient'. When I run npm run dev I get the following error message on the ...
Amy's user avatar
  • 11
1 vote
0 answers
189 views

How to link supabase table with foreign key to User Data, using NestJS and typeorm?

I just create a Supabase DB using NestJS and TypeORM. I have some entities like this: @Entity() export class UserService { @PrimaryGeneratedColumn() id: number; @OneToOne(type => User)...
queng's user avatar
  • 49
1 vote
0 answers
217 views

Electron : how to manage user auth in main and renderer process?

I am building an Electron App with this user flow: 1- User logs in 2- Enters local db credentials 3- App fetch local db every X minutes 4- App sends data to somewhere else logged in as the user Since ...
pida's user avatar
  • 386
1 vote
0 answers
224 views

Disable supabase reads but allow real-time updates to anon and authenticated

I want to use supabase only for real-time updates of the PostgreSQL database. Meaning that I don't want to allow anon/authenticated to read/update/insert/delete, but only want to push live changes ...
Rutger Versteegden's user avatar
1 vote
0 answers
227 views

Unable to get updated session in Supabase after password login

I have this code which signs in a user in a sign in page: else if (type === "password") { if (password1.length < 6) { toast.error("Password must be at ...
themrdan's user avatar
  • 107
1 vote
0 answers
798 views

Can't get the user's session on the server side using Supabase

I'm reading these Supabase authentication tutorials (for example this one) where they feature some code on Next.js' API routes like this: (pages/api/getUser.js) export default async function getUser(...
Facu Bozzi's user avatar
1 vote
0 answers
314 views

Supabase Dashboard error (self-hosting): "Failed to create user: User not allowed", when i try to create a new user

When I try to create a new user I receive the following error, does anyone know why it happens? I'm new to supabase and don't have much experience. supabase dashboard error In the .env file, the only ...
Jhonatan Lituma's user avatar
1 vote
0 answers
746 views

Getting "code challenge does not match previously saved code verifier" error on supabase github auth

I was trying to make github auth work on an next.js application with supabase, everything seems to work but when the user is redirected back from github to the site, the site encounters an supabase ...
Harsh Agrawal's user avatar
1 vote
0 answers
542 views

Supabase-js: querying foreign table returns null

I have a table Requests with 2 foreign keys referencing auth.users and Categories Requests ------------------------------------------------------------------------------ | user_id (= auth.users.id) | ...
lumikso's user avatar
  • 13
1 vote
0 answers
68 views

Unable to Update first_name and last_name Columns in public.profiles Table Using Supabase (React Native)

I'm working on a project that uses Supabase as the backend, and I've set up a public.profiles table to store user profile information. The table structure looks like this: create table public....
Owen's user avatar
  • 21
1 vote
0 answers
562 views

Upsert and return all rows with supabase-js

I'm using the supabase js client. I have an array of records I'd like to insert into my table and return. The records must be unique, so if they already exists in the table they should be ignored, but ...
joudan's user avatar
  • 91
1 vote
0 answers
231 views

Can we fetch data from storage schema while fetching data from the public schema in Supabase?

I have a table product which has a foreign key relation with storage.objects.id. (https://i.stack.imgur.com/DqJTR.png) From the client, I wanted to produce data along with the data of the storage....
Mohammed Yasin Mulla's user avatar
1 vote
1 answer
735 views

Creating new table in Supabase client side?

I am trying to create a supabase table client side using RPC. I have setup a function in supabase to be called when RPC is invoked. Where I pass an table name client side in Next.js with pages router. ...
Aleksa_97's user avatar
1 vote
1 answer
541 views

Supabase JS: Best way to resubscribe to realtime database channel after it’s closed?

I’m using supabase-js with a React app, implementing its realtime functionality to get real-time updates from the database in the UI. Overall it’s working great. Sometimes, though, the realtime ...
Dave Feldman's user avatar
0 votes
1 answer
28 views

Insert JSON object into JSON array column

I am working on a small project to learn Supabase and NextJS. I am trying to add a JSON object to my sites array which is defined as a JSON array. I want to add the config (and more in the future) to ...
Chris McGlynn's user avatar
0 votes
1 answer
12 views

Calling Eventbrite API using Supabase edge function - why might a POST request give GET responses to endpoint

I'm using Supabase edge functions to make API calls to the Eventbrite API due to CORS constraints preventing me making the call from the client side of my React project. I'm trying to call the create ...
nearhanfarhan's user avatar
0 votes
1 answer
44 views
+50

Supabase, how to get the session on the mobile, after the account has been confirmed on the website

I have the following scenario. A user creates an account on a mobile app and lands in the /confirm screen on the mobile app. A user confirms the created account via clicking on the confirmation link ...
Nikolay Melnikov's user avatar
0 votes
1 answer
19 views

Context returns null initially and screens do not re-render when context returns a session

I have three basic routes with tanstack-router. I simply want to to check if there is an active supabase session supplied by my auth context. If there is a session go to the signup-success screen, if ...
wind_kind's user avatar
  • 591
0 votes
0 answers
13 views

Storage of customer data to database during Supabse authentication process

in my mobile application, 2 different types of users are auth. client doctor. If type=client the data to the Client database must be stored. If type=doctor the data to the Doctor database must be ...
Eldor's user avatar
  • 1
0 votes
0 answers
24 views

Not able to fetch Signed in user from Supabase after google Oauth Sign in

I am using Supabase OAuth for google sign up in my project. Below is the code where I have specified the redirect URL: const { data, error } = await supabase.auth.signInWithOAuth({ ...
Mohd Zaid's user avatar
  • 117
0 votes
0 answers
10 views

npx supabase start Cannot find module: '../util/template'

When I run npx supabase start after npx supabase init and a few npx supabase start and npx supabase stop, Error: Cannot find module '../util/template' will occur. It is same when I run npx supabase ...
Probmkr's user avatar
0 votes
1 answer
27 views

Error Inserting into Supabase: Type of 'await' operand must either be a valid promise or must not contain a callable 'then' member

I'm getting this error Type of 'await' operand must either be a valid promise or must not contain a callable 'then' member.deno-ts(1320) In my Subapase Edge Function whose code is as follows: import {...
John Solly's user avatar
0 votes
1 answer
91 views

Supabase query for many to many relationship

I am trying to find a proper way to query m2m data using supabase client. I have three tables: public.sites column format id int8 name text auth.users (supabase auth table) column format .. ... ...
fparaggio's user avatar
  • 403
0 votes
0 answers
68 views

Supabase Functions - trigger when a file uploaded into Storage bucket

I'm looking to create a "pipeline" to manipulate a user's file uploads from a form in my Next.js application. The files are uploaded into a bucket called user_uploads I want a Supabase ...
user5156141's user avatar
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 ...
Leonard Marshall-Afzal's user avatar
0 votes
0 answers
46 views

Can't get variables with supabase status on github actions

When I start supabase locally and run pnpm supabase status -o env I get a nice collection of env vars, like ANON_KEY="eyJ...CJ9.eyJpc3......MTI5OTZ9.CRXP1A7WOeo....I0" API_URL="http://...
J.James's user avatar
0 votes
1 answer
148 views

How to set Supabase auth credentials in NodeJS?

I'm attempting to break my supabase database interactions out of my client Flutter app and into it's own dedicated NodeJS express app. At the moment, I've attached the credentials from the logged in ...
kevin's user avatar
  • 3,208
0 votes
0 answers
27 views

Supabase Javascript Realtime subscription useState not in sync

When calling the callFunc outside of this subscription context everything works fine and all my items are logged. However when I add a new Task callFunc will get called but the logged state is the ...
Henrik's user avatar
  • 886
0 votes
1 answer
49 views

supabase ilike with multiple reference table

Is it possible to do filters or with multiple reference tables, like if we do it in raw postgresql query like below (just for example): SELECT reports.*, report_categories.*, report_details.* FROM ...
Muhammad Haekal's user avatar
0 votes
0 answers
30 views

Self Hosting Supabase: Twitter Provider Oauth issue

how can i use twitter on self hosting instance on supabase? I read the docs but i don't found anything related to that concept. Also i look the docker compose and env files and i don't find any ...
abdul rauf's user avatar
0 votes
0 answers
94 views

Supabase Magic Link not working in Next.js 14

Magic link works when sent from Supabase dashboard, but not when sent from Next.js. The return url includes code in the searchParams instead of the intended token. Code // middleware.ts import { ...
andrilla's user avatar
  • 609
0 votes
1 answer
129 views

Supabase, Clerk, React, Vite: Multiple GoTrueClient instances detected in the same browser context

I'm trying to create a very basic app in which I'm using Clerk for Auth and supabase as my db. I've followed the tutorials that I could find and stitched something together which works pretty well ...
somethingElse's user avatar
0 votes
0 answers
118 views

Only able to get specific columns with Supabase and Next.js

I'm only able to fetch certain columns out of my database. I'd like to get every row out of my table, but when I select all, nothing is returned. My table (shows) has 9 columns. I just created the ...
wpix's user avatar
  • 1
0 votes
0 answers
17 views

I want to create a local language dictionary

I created this stored function to retrieve my data CREATE OR REPLACE FUNCTION generate_word_data(word_input VARCHAR(255)) RETURNS JSONB AS $$ DECLARE word_record RECORD; phonetic_record RECORD;...
Try and Error World's user avatar
0 votes
0 answers
117 views

Supabase and Next.js - How to make change password page accessible only to authenticated users

I have a next.js application and I am following the documentation for allowing users to reset passwords. So far, I built the password reset page and made it publicly accessible with a form asking for ...
AbedDoesCode's user avatar
0 votes
0 answers
26 views

Supabase SQL query function getting error 'structure of query does not match function result type'

I created a SQL query function for fetch projects from table but I am getting error structure of query does not match function result type Here's the function: CREATE OR REPLACE FUNCTION public....
Harpreet's user avatar
0 votes
1 answer
87 views

How to join table many to one via supabase in reactjs?

I have a table where when I test it with the following query select *, category_product from product inner join category on product.category_id = category.id inner join type on product.type_product = ...
FathTech's user avatar
0 votes
0 answers
59 views

How do I check if a vector exists in the Supabase vector database?

const data = await req.json(); const { url, prompt } = data; const model = new ChatOpenAI({ modelName: "gpt-3.5-turbo" }); const loader = new CheerioWebBaseLoader(url); const docs =...
Canberk Koç's user avatar