Questions tagged [supabase]
Supabase is a collection of open source tools to build modern applications quickly and efficiently. It uses the PostgreSQL database to power its authentication, database, and storage features. Use this tag when you are having problems, and not to ask for new features.
1,791
questions
3
votes
0
answers
67
views
Supabase JavaScript Client multiple joins
I am facing a problem with my supabase + Nuxt application
In Supabase I have setup the following tables. Users, Events and a many-to-many reference table called Guests.
1 User can host 1 event
n ...
3
votes
1
answer
468
views
Vercel Express 500 preflight error and custom headers not send
I am trying to create an application with supabase as DB, vercel backend (url: http://localhost:3000/api/) and netlify frontend (url: http://localhost:5173). The frontend is a react application with ...
3
votes
4
answers
2k
views
How can I implement Full text search by using Prisma + PostgreSQL ? (I'm using Supabase as the database)
This is my schema file:
generator client {
provider = "prisma-client-js"
previewFeatures = ["fullTextSearch","fullTextIndex"]
}
datasource db {
provider = "...
3
votes
0
answers
1k
views
Next.js and Supabase: Method expects to have requestAsyncStorage
The issue:
In prod, Next.js throws that error message: Invariant: Method expects to have requestAsyncStorage, none available. This error message occurs only server components and also in prod (Deploy ...
3
votes
0
answers
485
views
User gets logged in automatically when resetting password
I'm trying to develop a password reset process with Next.js (13.4) and Supabase Auth.
Issue:
After the user clicks on the password reset link received via email, if they refresh the page, they ...
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(&...
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 ...
3
votes
0
answers
906
views
Authentication error Supabase and Prisma on Nextjs
This is the error message I’m getting when i run npx prisma db push
I’ve created a project, database and a table in Supabase
I also have the schema.prisma file and passing the DATABASE_URL from ...
3
votes
2
answers
2k
views
supabase auth.uid() = user_id equals false
I have a very strange problem that is driving we up the walls.
I am creating the following table
CREATE TABLE articles(
id BIGINT generated by default as IDENTITY PRIMARY KEY,
user_id uuid ...
3
votes
0
answers
893
views
Supabase functions local development setup error: Cannot assign requested address
I am using Supabase as my BaaS, and i have developed and deployed multiple Edge functions. Now i am attempting to develop and debug them locally. However, i am having some issues.
As described here ...
3
votes
0
answers
440
views
Auto-Incrementing IDs in Composite Primary Key
In my app, there are organizations that can create tasks. Instead of having a serial task ID, I would like to have an incrementing task ID for each organization ID. Just like in GitHub, where repo + ...
3
votes
0
answers
208
views
Supabase check whether a user is currently in/listening to a realtime channel from postgres function
How can one, from a postgres function, check whether a user is currently in/listening to a realtime channel?
I want to create notification entries in the database only if the user is not currently ...
3
votes
1
answer
1k
views
Supabase types errors
Im using supabase with typescript and get some errors. I see them in webstorm, but not in vscode. Could u help me?
supabase
.channel('custom-all-channel')
.on(
'postgres_changes',
...
3
votes
0
answers
994
views
GetStaticProps Revalidate is not working as expected
Problem:
Revalidate doesn't work when im useing (serverSideTranslations) from next-i18next. Please see my code below.
When a new user register, an static page is generated for each language: (da (...
3
votes
0
answers
315
views
How to filter text array with items in list case insensitively in Supabase?
I have a text array (text[]) in Supabase. Let's say it's like this:
["Car", "Red", "New"]
I would like to get this row by filtering with list of words. So when I query ...
3
votes
0
answers
1k
views
Query JSON array of object in Flutter Supabase
I'm using Flutter and Supabase and I'm trying to fetch all elements in a table that partially match an array field.
I have a table with a jsonb array column that contains a list of objects (PollItem) ...
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 ...
3
votes
1
answer
2k
views
How to sign in with Apple and Google credentials in react-native and supabase
I have been trying to implement sign in with google and apple using the following libraries and supabase in bare react-native projects.
react-native-apple-authentication
react-native-google-signin
...
3
votes
3
answers
249
views
Conditionally rendering UI based on cookies and supabase affects the rest of my program Next.js 13
I am trying to conditionally render an account button when a user is authenticated; render a login + sign-up button when the user is not authenticated as follows:
My DesktopBar.tsx file
import { ...
2
votes
3
answers
4k
views
I can’t get Supabase real-time listen to Postgres changes to work
Inspired by the Supabase docs, I have this code in a React Native app:
useEffect(() => {
if (session?.user?.id === null) return
const channel = supabase
.channel('value-db-changes', { ...
2
votes
1
answer
2k
views
Supabase how to query the same table twice
I have been experimenting with Supabase recently and trying to make a twitter like 'replying to @user' comment feature.
So I have a database ERD attached below for reference, As you can see each ...
2
votes
2
answers
2k
views
Uploading Base64 images to supabase
My website wants to reduce the amount of things users can do with the images...so for added security, we want to keep the image sources as a base64 strings instead of a supabase storage URL. Is this ...
2
votes
6
answers
10k
views
Get supabase `user` server side in next.js
I am attempting to get the current logged in supabase user while server side.
I have attempted to use const user = supabase.auth.user(); but I always get a null response.
I have also attempted const ...
2
votes
1
answer
4k
views
Github actions failing after upgrading to node v20
I'm trying to create a github workflow for my repo that is using supabase edge functions. The error I'm receiving is: Node.js 16 actions are deprecated. Please update the following actions to use Node....
2
votes
1
answer
1k
views
Is there a better way to access Supabase generated TS types?
I have created a table called customer in my supabase db.
Generated my types using
npx supabase gen types typescript --project-id "$PROJECT_REF" --schema public > types/supabase.ts
In my ...
2
votes
1
answer
5k
views
Importing Data into a Table in Supabase
Is it possible to import data into a table in supabase?
For example if I have either a csv file or a json file -- can I import that data into a table via the backend of supabase?
2
votes
1
answer
877
views
Row-level-security dual join
I have three tables
journeys
id
user_id
...
sections
id
journey_id
...
stops
id
section_id
...
I want to use row level security to make sure that a user can only insert a stop if the uid()...
2
votes
1
answer
7k
views
Redirecting to Origin URL with Next.js Route Not Working
I'm currently working on a Next.js application where I have a layout component inside the app directory. Within that component, I have a navbar client component. I'm attempting to implement a logout ...
2
votes
2
answers
3k
views
How to use the signUp() method in Supabase to add additional user info when signing up
I am attempting to build a Vue.js application that includes authentication with Supabase. I wish to use the built-in Supabase signUp() method to handle additional user data when signing up. To do this,...
2
votes
1
answer
2k
views
How to check if user already exists in Supabase?
How can I check if a user with the same email already exists when Enable email confirmations is turned on.
When Enable email confirmations are turned on an obfuscated / fake user object is returned by ...
2
votes
2
answers
6k
views
How to get url of uploaded media in supabase storage in flutter?
In flutter for uploading image according to doc is
final avatarFile = File('path/to/file');
final response = await supabase
.storage
.from('avatars')
.upload('public/avatar1.png', avatarFile, ...
2
votes
2
answers
4k
views
How i can pull all data project production to local enviroment in supabase
I have created a project using supabase platform directly and not in local enviroment so all tables are in production, but now i need a local enviroment for development o test so i created a local ...
2
votes
2
answers
2k
views
Row-level-security based on relation table data
I am getting into Supabase and to practice I am making a suuuper simplified website-builder.
However I am having troubles with the row-level-security policies.
I have three tables:
user → with users' ...
2
votes
3
answers
5k
views
Row-level security problems when creating a supabase's bucket
everyone.
I'm new to Supabase and I'm exploring all the features available in this amazing platform. Unfortunately I'm having some troubles with bucket creation. I tried also create manually the ...
2
votes
2
answers
2k
views
Match PotsgreSQL timestamptz by exact value
I am using PostgreSQL 13.3 via Supabase.io. I have a table with a field called modified_at which has a type of timestamptz:
CREATE TABLE IF NOT EXISTS knowledge_views (
id uuid NOT NULL DEFAULT ...
2
votes
2
answers
1k
views
Where to store media file of Django on production?
So I am learning Django. And I have made some websites with it. Now I am hosting those to Heroku. I am using free Dyno on Heroku. Also, I am using supabase.io database instead of Heroku's because ...
2
votes
1
answer
6k
views
Supabase JSON query JavaScript
Im trying to fetch single entry from my table that contains and JSONB array of objects. Can I match somehow that array to find the desired result?
[
{
"chats": [
{ &...
2
votes
1
answer
1k
views
Why am I getting "URL.hostname is not implemented, js engine hermes" when supabase is intialized?
I am building an expo project. So far I'm just trying to create the login/sign up auth logic. I want to use supabase. The project will load if there is no supabase initialization, but when supabase.js ...
2
votes
1
answer
2k
views
Supabase update with incrementing value
I am using supabase-js and have a table like this:
userID: string
timesVisited: number
eventName: string
I am using update like this:
Admin.from(tableName).update([{userID,eventName,timesVisited}])
...
2
votes
2
answers
1k
views
Error:createClient is not defined When using supabase cdn
I'm using Supabase CDN's for a project. When I call the createClient() function this error comes up:
createClient is not defined
I tried it with an older version of the CDN, with another browser and ...
2
votes
1
answer
4k
views
Cannot log out user on the server side (Next.js and Supabase)
How can I log out a user on the server side when using Supabase as the auth provider?
I thought the simplest and most obvious solution would be to just do that:
export const getServerSideProps: ...
2
votes
1
answer
2k
views
How to query text[] column in Supabase?
I want to retrieve rows based on a value being present in text column defined as multidimensional array in Supabase
Table looks like following
I am trying to query this records using following urls
...
2
votes
2
answers
2k
views
Supabase policies on getServerSideProps - Next.js
I'm crafting a Trello clone with Next.js and Supabase as a BaaS.
In my Supabase table I have this policies:
Policies are working grate on client side with the following code:
const { data } = await ...
2
votes
1
answer
214
views
How to get width / height of a base64 image in deno?
This is a repeat of this question: Get image width and height from the Base64 code in JavaScript but I am asking with regards to deno. Deno does not have the new Image() that is used in all the ...
2
votes
2
answers
1k
views
Handling Sign Up with Existing Email in Supabase
I'm working on a sign-up feature using Supabase and I want to provide feedback to the user if they try to sign up with an email that already exists in the system. However, I'm facing a challenge in ...
2
votes
2
answers
1k
views
Supabase with Next.js 13 App Router OAuth not logging in
Whenever I log in with
// twitch signin handler
const handleTwitchSignIn = async () => {
const { data, error } = await supabase.auth.signInWithOAuth({
provider: "twitch",
...
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
1
answer
692
views
Supabase and Cloudflare Workers
How do i protect a Cloudflare Worker route to authorize only if the user is authenticated on Supabase?
I'm using Cloudflare Pages Function to create a worker inside the Cloudflare Pages: https://...
2
votes
1
answer
1k
views
How to subscribe to realtime data from Supabase in React Native application?
When I try to subscribe to my Supabase database for realtime updates, I am able to listen to changes (Insert/Update/Delete) but my React state resets.
For example, let's say I get 5 names in the ...
2
votes
1
answer
772
views
How to escape string characters in supabase js OR query?
I'm trying to write a query that matches rows where a user-provided string matches one of two text array columns.
For example, imagine a table messages with text columns greeting and goodbye:
// WORKS
...