https://supabase.com/ logo
Join Discord
Powered by
# help-and-questions
  • Can I make Twitter API requests as a user?
    r

    raae (queen.raae.codes)

    08/24/2022, 6:17 PM
    Do I have the info needed after a user signs in with Twitter to make requests on their behalf?
    s
    • 2
    • 2
  • Only insert nullable column if not null
    m

    Max52

    08/24/2022, 6:29 PM
    I'm inserting a row into my threads table and I want to only include a reference to the categories table if the user selects a category. I'd like to be able to just insert as usual (
    {category_id: category}
    and if category is null, the column stays null. The issue is I get an error stating that it cannot be inserted as a uuid. Thoughts?
    s
    • 2
    • 3
  • Server side auth via the supabase React client
    j

    Joyboy

    08/24/2022, 9:19 PM
    Hi! I was wondering if it's possible to send the user credentials from my React client to my Nestjs API, in order to define the user right to make some actions (send an already authenticated users data to authenticate it in the backend before any action) My idea was to use the React Supabase client to auth users and then send the credentials to the API when the actions needs to be handled server side. I don't know if I'm planning this the proper way. Thanks in advance!
  • Help with restore password
    f

    Fran Mella

    08/24/2022, 9:47 PM
    I do this on Nuxt 3
  • Help with auth - 'Request failed' Error on auth.signIn() from VSCode
    f

    fernandops26

    08/24/2022, 10:43 PM
    Hi Guys, I am trying setting the user using the refresh_token obtained by callback to my VSCode extension on the url fragment: This is my code:
    Copy code
    js
    // credentials object is an object containing the access_token, refresh_token created from the URL Fragment
    
    // trying do a signIn
    const data = await supabaseClient.auth.signIn({
                refreshToken: credentials.refresh_token,
    })
    I am doing it according to this example on React Native but in VSCode: https://supabase.com/docs/reference/javascript/auth-signin#sign-in-using-a-refresh-token-eg-in-react-native But, I did receive the
    Request Failed
    message on the
    data
    object:
    Copy code
    json
    {
        "user": null,
        "session": null,
        "error": {
            "message": "Request Failed"
        }
    }
    BTW I am using the
    supabase-js
    client V1.
    g
    • 2
    • 4
  • Compliance - Non-editable column to keep track of user acceptance of Terms & Conditions
    s

    sb

    08/24/2022, 10:58 PM
    In order to be compliant, we need to keep track of when a user accepts our T&C and what version of those T&C. The tricky thing is: it needs to be in a format that is non-editable. Any recommendation on how to make a table where the values are non-editable? Ideally the table could have a non-editable createdAt that is set in the creation of a new row and not by us manually
    g
    n
    • 3
    • 11
  • supabase realtime INSERT and UPDATE not working?
    u

    7seas3c

    08/25/2022, 3:33 AM
    Im using
    supabase-js
    library and I wanna listen to every events on every table
    Copy code
    js
    
    const socket = new RealtimeClient(process.env.REALTIME_URL, {
        params: {
            apikey: process.env.REALTIME_API_KEY
        }
    })
    
    socket.connect()
    
    const PTListener = socket.channel('realtime:public:*')
    
    
    // BUG only DELETE works
    PTListener.on('INSERT', (change) => {
        console.log('INSERT on PTListener', change)
    })
    PTListener.on('UPDATE', (change) => {
        console.log('UPDATE on PTListener', change)
    })
    PTListener.on('DELETE', (change) => {
        console.log('DELETE on PTListener', change)
    })
    but only only trigger on
    DELETE
    , but not on
    INSERT
    or
    UPDATE
    .
    g
    • 2
    • 15
  • Help with session - I can't get the refresh_token
    f

    fernandops26

    08/25/2022, 5:37 AM
    I am trying to get the
    refresh_token
    from an already logged user using
    supabaseClient.auth.session()
    when load the page but doesn't return that value. This is the code
    Copy code
    js
    import { supabaseClient } from '@supabase/supabase-auth-helpers/nextjs';
    import { useUser } from '@supabase/supabase-auth-helpers/react';
    
    const Onboarding = () => {
      const { user } = useUser();
    ...
      useEffect(() => {
        if (user) {
          console.log('session: ', supabaseClient.auth.session());
    ...
    }
    The value displayed is:
    Copy code
    json
    {
        "access_token": "user.jwt.tokenxxxx",
        "token_type": "bearer",
        "user": null
    }
    Why I can't access the refresh token?
    n
    • 2
    • 3
  • why can't i see edge functions in self hosted version
    t

    Thoth Trismegistus

    08/25/2022, 5:48 AM
    I just created a self hosted version of supabase.
    k
    • 2
    • 1
  • Supabase JS RC Insert returns undefined but database have result?
    z

    Zapuzu

    08/25/2022, 5:59 AM
    const { data: record, error } = await supabase .from('Blog') .insert({title: 'hi'}).single(); if (error) { console.log(error); } console.log(record); // undefined?
    j
    • 2
    • 3
  • How to get the current date with the date type?
    d

    Deleted User

    08/25/2022, 7:39 AM
    How would I get the current date as default value when using the date type inside supabase?
    u
    • 2
    • 2
  • Copy Paste JSON into Column via Supabase GUI
    a

    alx90

    08/25/2022, 1:06 PM
    Hey guys, it is possible to copy paste normal JSON like:
    Copy code
    [
        {
            "name": "Hero",
            "fields": {
                "btn_left": {
                    "text": "Get started",
                    "link": "/"
                },
                "btn_right": {
                    "text": "Learn more",
                    "link": "/"
                }
            }
        },
    ]
    Into a json supabase column via the supabase gui? Thanks for reply guys ❀️
    g
    h
    • 3
    • 3
  • match n 1 relation
    m

    magicbyt3

    08/25/2022, 1:12 PM
    I have 2 tables users and user_roles my users table contains auth.uid() and nickname and my user_roles table contains user_id and a rolename (admin for example) now I want to query all users with role admin in my svelte app. How would I do that? Thanks in advance!
    s
    g
    • 3
    • 12
  • Filter query unless filter param is null
    m

    Max52

    08/25/2022, 1:37 PM
    My goal is to filter the query results to only get posts (think any social media) with a specific tag. The tag is getting send as a search param in the url, and I can filter properly when there is a search param to filter, but I want to ignore the filter if it's null. Essentially, how can I void the
    .eq("tag", null)
    when the match case is null, that way I get all posts instead of none.
    g
    • 2
    • 1
  • Can't use UUID string when uploading row
    e

    elhe26

    08/25/2022, 1:44 PM
    Hi all, I'm trying to use an UUID string as a parameter to upload it in supabase. The error I'm getting is the following:
    Copy code
    {
      code: '22P02',
      details: null,
      hint: null,
      message: 'invalid input syntax for type bigint: ""'
    }
    m
    • 2
    • 11
  • [GraphQl] Using Anon key does not return any data from RLS protected tables
    s

    SeΓ±or Bruno

    08/25/2022, 3:22 PM
    Hi. I am using the service_role secret as the API key for the graphql setup. However, for tables with RLS protection I do not get any data back. If I turn RLS off the data is there. What do I need to do in order to make my admin key have full permission?
    g
    • 2
    • 10
  • How to read user_metadata inside trigger function when new user is created?
    d

    devstojko

    08/25/2022, 4:25 PM
    Copy code
    begin
      insert into public.profiles(id, username)
      values(new.id, new.user_metadata.username);
    
      return new;
    end;
    This doesn't work. It says that user_metadata doesn't exist in new. On signUp, I send data: { username }
    g
    • 2
    • 15
  • heroku to supabase migration
    j

    Jenaro Calvino

    08/25/2022, 5:04 PM
    I'm trying to follow the instructions on this github readme https://github.com/supabase-community/heroku-to-supabase But when I run the pg_dump I'm getting the following error:
    Copy code
    bash
    pg_dump: error: connection to server at "ec2-54-224-120-186.compute-1.amazonaws.com" (54.224.120.186), port 5432 failed: SSL error: certificate verify failed
    connection to server at "ec2-54-224-120-186.compute-1.amazonaws.com" (54.224.120.186), port 5432 failed: FATAL:  no pg_hba.conf entry for host "152.171.245.125", user "myuser", database "mydb", SSL off
    I'm wondering how to force SSL and how to get the cert for that matter, I don't know where on heroku that's supposed to be, thank you so much
    o
    • 2
    • 3
  • Initialising Supabase client on latest version with nextjs
    l

    lukehennerley

    08/25/2022, 5:53 PM
    Hi, I just upgraded to latest
    rc
    of Supabase to use the new auth component, unfortunately, now I get the error attached in the image. I am not doing anything complicated, my
    supabaseClient.ts
    looks like this (ignore the keys I have them correctly being passed):
    Copy code
    import { createClient } from '@supabase/supabase-js';
    
    // Create a single supabase client for interacting with your database
    export const supabase = createClient(
      'https://xyzcompany.supabase.co',
      'public-anon-key',
    );
    Login.tsx looks like this:
    Copy code
    import { supabase } from '@/utils/supabaseClient';
    import { Auth, ThemeSupa } from '@supabase/auth-ui-react';
    import React, { useState } from 'react';
    
    const Login = () => <Auth supabaseClient={supabase} />;
    export default Login;
    This is on version 12.2.2 of NextJS - any ideas? I haven't messed around in the web world for a long time so I am guessing it might be something in my tsconfig that I am missing blindly.
    p
    • 2
    • 3
  • RLS policy with join not working
    m

    Max52

    08/25/2022, 7:18 PM
    I've structured my insert RLS policy to what I think would work based on the docs and my tables:
    Copy code
    sql
    (has_course(( SELECT course_id
       FROM thread
      WHERE (thread_id = id)), uid()) AND (user_id = uid()))
    However when I save and try it, I get an RLS error. Then when I go into the policy editor, it changes to:
    Copy code
    sql
    (has_course(( SELECT thread.course_id
       FROM thread
      WHERE (reply.thread_id = thread.id)), uid()) AND (user_id = uid()))
    Which might just be a more explicit version that Supabase automatically updates to? Either way, I can't seem to get this policy working right.
    g
    • 2
    • 10
  • How to INSERT a record and get the new row back in the return data with supabase-js?
    r

    RogerThis

    08/25/2022, 8:38 PM
    Hi. Like the title says I am trying to insert a record and get that record back in the data property of the response so that I can read the newly created id. But it is returning undefined. I'm using @supabase/supabase-js: v2.0.0-rc.6 with the service role key. sorry if this is basic, I tried the docs already with no luck.
    g
    • 2
    • 4
  • Not able to save email template
    s

    Swapnil

    08/25/2022, 9:26 PM
    1. While making changes it says failed to update settings. I am using Supabase auth here
    g
    • 2
    • 31
  • Integrate Images in Email Template
    a

    AdrianMsM91 {KBL}

    08/25/2022, 9:37 PM
    Hello, how can I integrate images in the email template? url ? Thanks!
    g
    • 2
    • 10
  • Info about GDPR
    t

    theuknowner

    08/25/2022, 10:56 PM
    Is Supabase compliant to GDPR? I didn't find anything about it on privacy-terms.
    g
    • 2
    • 1
  • RLS Update Own Profile - Denied
    l

    lucasb

    08/26/2022, 3:44 AM
    I am following the Public Access example in the docs to allow "User can update own profile" (https://supabase.com/docs/guides/auth/managing-user-data) I am getting access denied for the policy:
    Copy code
    create policy "Users can update own profile."
      on profiles for update
      using ( auth.uid() = id );
    using this update statement with the supabase js client:
    Copy code
    const { data, error } = await supabase
      .from('profiles')
      .update({
        ...formValues,
      })
      .match({ id: user?.id });
    any idea why? This is on a nextjs page where the user is authenticated
    j
    g
    • 3
    • 41
  • Supabase Auth with Playwright
    z

    Zozo

    08/26/2022, 8:18 AM
    Hello! I am using playwright in my app but I need to fetch some protected data by RLS. So my question is how do I authenticate playwright with my supabase user?
    g
    • 2
    • 1
  • Replacing my city_id with cities.name
    s

    Sanctus

    08/26/2022, 9:11 AM
    Here is the query I'm doing so far:
    Copy code
    ts
    const { data, error } = await supabase
        .from(health_facilities)
        .select('*, health_facility_categories!inner(*)')
        .eq('health_facility_categories.name', 'clinic')
    Now, in my health_facilities table I have a city_id column with a foreign key to the cities table. How can I replace the city_id with the cities.name in my result?
    s
    • 2
    • 2
  • Hosting in Europe?
    s

    sinnvoller

    08/26/2022, 9:41 AM
    We are considering to use supabase for one our clients next project. Because of regulations we need the server to be located in germany or at least within europe and we are wondering, if there is any possibility within the cloud version to choose where the servers are located or are we forced to use the self hosted version?
    v
    b
    • 3
    • 4
  • insert an array of objects
    t

    TARS

    08/26/2022, 11:23 AM
    Hello, I'm trying to insert an array of objects into a supabsae column. It's an array of these kinds of objects, and it's only strings. { id: response.data.public_id, url: response.data.secure_url } The funny thing is that in supabase I get a lot of \ etc instead of spaces. How Can I deal with this? This is how it looks in supabase:
    Copy code
    [
      "{\"id\":\"hostpictureupload/hjpxjha1tyysgnwi9w9z\",\"url\":\"https://res.cloudinary.com/duj052tmt/image/upload/v1661512384/hostpictureupload/hjpxjha1tyysgnwi9w9z.jpg\"}",
      "{\"id\":\"hostpictureupload/irrxsmu6ri6u9k0ibcgp\",\"url\":\"https://res.cloudinary.com/duj052tmt/image/upload/v1661512384/hostpictureupload/irrxsmu6ri6u9k0ibcgp.jpg\"}",
      "{\"id\":\"hostpictureupload/uzk1fmgoygeq3m2qxjlh\",\"url\":\"https://res.cloudinary.com/duj052tmt/image/upload/v1661512384/hostpictureupload/uzk1fmgoygeq3m2qxjlh.jpg\"}"
    ]
    Why are there \ ?
    g
    • 2
    • 10
  • Does Google or Facebook as sign in providers return the user's public phone number?
    a

    Abulmagd

    08/26/2022, 11:38 AM
    Using Flutter, I have implemented Google and Facebook sign in, is it possible to get the public phone number of the user?
1...91011...230Latest