https://supabase.com/ logo
Join Discord
Powered by
# help-and-questions
  • Is it possible to get a user's access token using Supabase JS(to request resources for API?)
    c

    Chen

    03/10/2023, 2:18 AM
    Context: I'm building an app that lets you know when your friends are starting a spotify listen session. The way it works is that you'd sign in + give us permission to your information with Spotify OAuth and the app's server will ping the Spotify API regularly to notify your friends if you start listening to music. **Question**: We need the user's access token in the backend in order to send the get requests. To my understanding, I can't just give supabase auth a user ID and have supabase return an auth token. Does that mean I need to store the user access token + refresh token in a database? For some reason that doesn't seem to be right... Would love some input on this!
    g
    s
    • 3
    • 6
  • I implemented "Login with Apple" through Supabase OAuth. How to revoke token?
    h

    heygwangjin

    03/10/2023, 4:13 AM
    Hello I implemented Apple social login with "Login with Apple" in Supabase OAuth. I want to unlink user and our app when user wants to withdrawal, so I was searching how to do it and finally I got it that I can do it using "Revoke tokens API" in Apple documentation. The API requires 'token' field in HTTP Body to revoke tokens, so I used provider_token from Supabase to this field. But it didn't work well. I don't think provider_token is the value that this field requires. Then what is the value that goes into this field? Thanks in advance. This is url of "Revoke tokens API" https://developer.apple.com/documentation/sign_in_with_apple/revoke_tokens/
  • When fresh my page,the auth request many times ,and the useAuth() function return null
    b

    Btc-TenW

    03/10/2023, 4:27 AM
    My Code as below:
  • Selecting single item from foreign table in query
    e

    elliott

    03/10/2023, 4:55 AM
    Is this possible in the supabase sdk without using rpc?
  • Using Supabase with Chrome Manifest V3
    j

    Jimbread

    03/10/2023, 5:08 AM
    Hi All. I've been working on a chrome extension and trying to use Supabase with it to set up Auth and to later store and retrieve data from supabase. Given MV3's constraints, there is essentially no way for me to import the supabase client into the chrome extension, and therefore have no way to interact with it. Here is what I want to do: 1a. Sign in/Sign up new users, triggered from Chrome Extension โœ… 1b. Validate the user's token for future sessions ๐Ÿšซ 2. Send data from chrome extension to supabase ๐Ÿšซ 3. Retrieve data from supabase to chrome extension ๐Ÿšซ Essentially, I'm just trying to interact with the supabase client or my instance one way or another. Here are some potential solutions I can think of... 1. find some compressed supabase.js script that I can import locally (In chrome extensions, you can import local scripts, just nothing from the internet) - I saw this on an article on the same issue regarding firebase (https://dev.to/swimmingkiim/chrome-extension-with-firebase-manifest-v3-27gc) 2. Somehow make calls to [...].supabase.co through rest calls (ex. fetch('http://example.com/movies.json');) I've been stuck on this today and am not sure where to go. Any advice would be greatly appreciated!
    c
    • 2
    • 8
  • Error adding user to database | Triggers
    z

    Zenon

    03/10/2023, 6:17 AM
    I'm following this video from Jon Meyers

    https://www.youtube.com/watch?v=0N6M5BBe9AEโ–พ

    where he creates a trigger, to insert into the profiles table when a new user is created. After creating this trigger, when I try to sign up, I get an error "Database error saving new user"
    s
    • 2
    • 3
  • kong user issue after package update
    k

    Krysalist

    03/10/2023, 8:48 AM
    Since I've updated my npm packages, this error appears when I'm trying to launch my local Supabase instance :
    Copy code
    $ pnpm supabase start
    Applying migration 20230127002643_locations.sql...
    Seeding data supabase/seed.sql...
    Error: Error response from daemon: unable to find user kong: no matching entries in passwd file
    Try rerunning the command with --debug to troubleshoot the error.
    How I can fix this ?
    • 1
    • 2
  • Redirecting with Auth Component
    c

    chrtravels

    03/10/2023, 8:56 AM
    Hey all, I am using the build in Auth component from the tutorial and the redirectTo doesn't seem to do anything:
    Copy code
    <Auth redirectTo={'http://localhost:3000'} supabaseClient={supabase} appearance={{ theme: ThemeSupa }} />
    It just goes to a blank page. The only thing that works is to redirect to another component. As in the tutorial, they intend you do redirect to the account edit page but who really wants to do this in practice? I just want to redirect back to the home page:
    Copy code
    {!session ? (
          <Auth redirectTo={'http://localhost:3000'} supabaseClient={supabase} appearance={{ theme: ThemeSupa }} />
        ) : (
          <Account />
        )}
    Any thoughts? I was going to go the route of building my own login/logout/forgot password but that seems like so much extra work to get right, when I would rather focus on the app build and come back to this later if I want a more custom solution.
    s
    • 2
    • 2
  • PGSODIUM with realtime
    e

    elliott

    03/10/2023, 9:09 AM
    Is it possible to encrypt a realtime database?
    s
    g
    • 3
    • 4
  • Query all tables in the Database, Query the columns in those tables.
    p

    paulgo

    03/10/2023, 9:24 AM
    Hi I was looking for a way to query all the tables in database and also how to query what columns are present in a particular table.
  • How to upload multiple images to storage and retrieve the urls
    s

    samuel83

    03/10/2023, 9:31 AM
    Can anyone help me to figure out how to upload multiple images to storage or point me to the right resources if any? I will really appreciate any help.
    j
    v
    • 3
    • 5
  • Implementing gamification
    h

    H3

    03/10/2023, 9:39 AM
    Hello, I'm working on an app currently where users can gain coins. The coins can be gained, and lost while playing various games. I'm wondering how such feature best can be implemented. some requirements: - each user has a balance of coins - when playing a game the balance is updated depending on the outcome. - users can claim new coins every 24/h Since I'm very new to supabase (and BE for that matter) I'm not entirely sure how I can prevent users from updating their own balance, or how I can add coins to their balance depending on the outcome of a game etc. Thanks
  • I have an ImageUrl , I want to store it in the storage.
    k

    killerthief

    03/10/2023, 10:04 AM
    Hi guys , I have an ImageUrl , I want a way to store the image of it.
  • is it possible to make Supabase Storage as a substitute for DigitalOcean Spaces?
    y

    yuqi

    03/10/2023, 10:51 AM
    or are they different? if its possible how?
  • Service Role Key
    m

    Matthew ๐Ÿฆ˜๐Ÿซ•

    03/10/2023, 11:11 AM
    Hi, I might be blind but I can't find where you get your service role key from? I've got the Authentication working in my vuejs frontend but I was planning on using the service role for my python backend, but I don't where to find it in the Dashboard? I was trying to follow this tutorial: https://egghead.io/lessons/supabase-use-the-supabase-service-key-to-bypass-row-level-security And I am just a bit confused as to the new location of the service role key is in the new Dashboard
    • 1
    • 2
  • can't invite users
    a

    AD DAB

    03/10/2023, 11:50 AM
    i have a supabase instance the hosted option, i'm trying to invite someone to work with me on the database but whenever i do they receive an email directing them to the localhost, how can i fix that?
    s
    • 2
    • 2
  • Why does upsert always returned 201/created?
    r

    rem

    03/10/2023, 12:05 PM
    As per subject, regardless of whether the record exists or not, the upsert method always returns status=201 and statusText=Created Is this a bug or intentional?
    j
    • 2
    • 1
  • Using Supabase as a Server with a built-in file system.
    f

    Fabrizio

    03/10/2023, 1:54 PM
    I am trying to build an infrastructure that allows an user to have a personal file system where they can create files, issue common bash commands and use common tools to interact with the file in the file system, like creating columns and rows in a database using SQLite and similar. I am thinking of self-hosting a supabase system for each collection of user (for example a company), where each collection of user has its own file system. I would like to use supabase to wrap around this file system as it would provide help with tasks such as authentication. I cannot use the built-in Postgres database as I would like to make it possible to have multiple databases in each storage instance. Is this possible with Supabase? I am pretty new to the backend world, so I apologize in advance in case I was not clear.
    e
    • 2
    • 2
  • supabase-js Select how to use AS to alias?
    e

    Eryou Hao

    03/10/2023, 2:15 PM
    the postgresql is like this:
    Copy code
    sql
    SELECT id, title, created_at AS note_date FROM notes ORDER BY note_date DESC;
    I want to alias the note_tag field in response:
    Copy code
    javascript
    const result = await supabaseServerClient
        .from('note')
        .select(`
          *,
          note_tag as tags (
            id,
            title
          )
        `, { count: 'exact' })
    but the
    note_tag as tags
    not work
    g
    • 2
    • 2
  • generate types from a self hosted instance in aws
    a

    Aissam

    03/10/2023, 2:26 PM
    Hi, Iโ€™m currently working on a Supabase+Nextjs project. My supabase instance is hosted on a ec2 instance, Iโ€™d like to generate types using the Supabase CLI in my nextjs project. Could you help me with that please ?
    e
    e
    • 3
    • 4
  • define as array how does that work?
    f

    funkyj

    03/10/2023, 3:30 PM
    Hi, i try the define as array option for a text type but how does this work? I cant find any docs about it. What is the correct why to file in the value? greetz, jordi
    g
    • 2
    • 3
  • Trying to request data on behalf of the users
    w

    Wee

    03/10/2023, 3:50 PM
    So I understand that supabase is using an older Auth library , but I noticed in this form that the developer has the option to input client id and secret while I have to put in keys. https://github.com/supabase/supabase/discussions/5915. Is there any way currently to get access tokens that work for oauth 2 through the supabase login flow ?
    s
    • 2
    • 1
  • Possible to get the type from a client.from().select() without running the select?
    p

    pid1

    03/10/2023, 3:55 PM
    I noticed the other day that joined types are now a thing and not just unknown, which is great! I'm tired of having custom types for every combination of select and foreign key joins. Is there any way to utilize this without dropping down to postgres-js?
    type Test = ReturnType<supabaseClient.from('a_table').select('*, a_foreign_row:a_foreign_table!a_foreign_row_id (*)')>;
    I've achieved what I want with:
    Copy code
    import { GetResult } from 'https://esm.sh/v111/@supabase/postgrest-js@1.4.1/dist/module/select-query-parser';
    type Test = GetResult<
      Database['public'],
      Database['public']['Tables']['a_table']['Row'],
      '*, a_foreign_row:a_foreign_table!a_foreign_row_id (*)'
    >;
    But getting it from our supabase client objects would be nice ๐Ÿ‘€
  • How to best decorate response objects?
    e

    elliott

    03/10/2023, 3:57 PM
    I'm wondering how I can add additional data to response objects. Say I have a table with a few fields, and my response object looks like this:
    Copy code
    {
      title: 'My Title',
      completed: true,
    }
    and I want it to look like this:
    Copy code
    {
        title: {
          value: 'My Title',
          type: 'text',
        },
        completed: {
          value:  true,
          type: 'checkbox',
        },
      }
    Basically, I want to take Supabase's response and map it to represent a form, with additional fields that describe how to build the form on the client...and hopefully still generate types. My fallback plan is to implement the mapping client-side. Not a huge deal, but I'm wondering if this sort of pattern, transforming and extending the data collected from the DB, is supported, and what Supabase calls it.
    g
    • 2
    • 2
  • Is there a database function return limit of 1000?
    k

    Kolby

    03/10/2023, 4:19 PM
    Running the query returns 1245 results, however when I run the function with supabase.rpc I only get 1000 results returned. Is there a limit of 1000?
    g
    • 2
    • 1
  • Tables per User
    d

    DaJacy

    03/10/2023, 4:28 PM
    I'm building an app where most of the time the users will just be using their own data. So I was thinking if I have a table, let's call it "todos", I'd much rather have a seperate table for each user, rather than a public table where all todos are inserted and marked with a userId column. I haven't found any info on if this is even possible if it is if it's a good idea. Any feedback would be appreciated. Also ready to hop on call if a short discussion with voice is better than writing it out in text. Thanks for the help!
    g
    • 2
    • 2
  • cannot update table: must be owner of event trigger pgsodium_trg_mask_update
    t

    turner

    03/10/2023, 4:32 PM
    Hey, I get this error if I want to add a column to a table
    Copy code
    failed to update pg.tables with the given ID: must be owner of event trigger pgsodium_trg_mask_update
    I do not know why this is. The table I want to update is in schema
    admin
    and is named
    marketplaces
    . I use pgsodium to protect some tables, but not the one
    admin.marketplaces
    . Looking forward for some help.
    s
    r
    • 3
    • 5
  • A way to get the tables details from the Database?
    p

    paulgo

    03/10/2023, 4:32 PM
    Is there a way to query what tables are in the database? Example: My project has 3 tables Athletes Sports Venues Is there a way to get the list of tables in the database and information of what columns they have?
    g
    e
    • 3
    • 13
  • Need help with Merkle Tree and CRDTs
    d

    DaJacy

    03/10/2023, 4:48 PM
    I recently watched "CRDTs for Mortals" by James Long and was completely fascinated. I'm now trying to implement this in my own app. So far I am stuck on the merkle tree though. If client A and Client B both change the same field, client B being the later write, then only client A would need to sync, right? but then doesn't the merkle tree of A include a hash that is not present in B? Does this mean that client B also needs to donwload the changes A made, even if they are not needed? Now that I say it it kinda makes sense, since the message from A could be for any field, and there's not really a 'only get the latest message per field' thing going on. And I guess if you don't implement something like this you just have to sometimes download old messages as well when they happen. Am I missing something here?
  • Which Stripe Connect type was implemented in this video?
    u

    Unknown Member

    03/10/2023, 7:02 PM
    Hi, in this video by Jon, I am wondering what Stripe API was used to automatically create the new customer profile? Was the API Stripe Connect? If so, is it Standard, Express or Custom? Thanks in advanced.

    https://www.youtube.com/watch?v=codAs9-NeHMโ–พ

1...162163164...230Latest