How can I connect Thunkable with Supabase

Hello - I am wondering if some one can build two example blocks to me -
One to connect to the supabase DB
And
One how to Post one datapost to a table
I am just trial and error all the time and thats because i do not understand the code presented to use.
How do i set up URL and REF ID etc to connect
And when connecting how to update a record.

That would do it…
@jared @tatiang or someone else who can help…??

Thanks in advance…

No Tips?

1 Like

@stefansladdeneng1 Can you share what blocks you have tried so far?

This is likely a web API setup, yes? Gathering any API documentation from Supabase will be important.

Sorry Matt - Been away for a few days.
The thing is @matt_conroy that; I tried a million versions so i even dont know whoich of the to send to you. I would really suggest to Thunkable to make a real difference here.
Build example blocks to connect and an example on how to build a search querie for the databases one can use. If and when such example exist it would be much easier for us non coders to understand how to… and we can focus on the actual development.

Again - i honestly dont know exactly what to send…
I hope you can help somehow…
Stefan

For the table you want, click the </> API button and paste the URL into thunkable. We’ll have two headers, one with the parameter apikey with the value of your key from the gear icon from the dashboard. The other one is Authorization with the value Bearer KEY
Note: Replace KEY with the value of your key from the gear icon from the dashboard.
RESPONSE: JSON List of objects

Thanks @vishruth-ram appreciate you answering. i do need some clarification though :smiley:

  1. URL’s i clear - I guess it should be set in the “Set URL” Block

  2. Then i Set one HEADERS block to APIKEY - This i also found
    BUT

  3. The Bearer Key i do not understand…
    First: Where do i find that? Cannot find anything mentioned as a BEARER KEY
    Secondly: When i have found it - Where do i Put it in Thunkable? In what block?
    The HEADER block is already set. is it BODY or?

  4. Finally, i have set a PWD when i created the SUPABASE DB - Where shall i use that? (If i should

Extremely grateful for an explanation here
Thank you :pray: :pray: :pray:

Type Bearer as the value and a space and enter your normal API key

Note: Please copy the URL from the table’s get code button in the “bash” language, not the settings page.

Are you using DnD or StP?
For DnD: Click the Gear Icon beside the API name. See the HEADERS section.

Doing StP in this app

So you mean
“URL” should be set to “postgresql://postgres:[YOUR-PASSWORD]@db.nttwarkfrrlbsxxtvkmf.supabase.co:5432/postgres” (where i change the password to the correct one in the url)

“HEADERS” should be set to “BEARER APIKEY”
Is this correct?

I cant get in contact with the DB
Using standrd SQL i can update a row in the DB from the SQL window in Supabase…
But i cant connect and therefore i dont know uf the SQL statement working from Thunkable blocks…
Perhaps this image will help you to help me…

Password shouldn’t be used

No need just https:// and [url]/v1/[table name]. And it isn’t good to expose API keys and URLs like that. There is no need for query parameters too. Use a create-object block to create both the apikey and authorization headers. I don’t know how to create a row with the REST API but use the Supabase. GET block to get all the rows.

1 Like

Thanks - I know its not best practice to share it like that. However since i have just started i can “redo” it and change pwd…But thanks - OK ill go wityh the creat block and see if i can get any progress in this drama… Thanks… Stay tuned…for some more result…

You’re definitely using the wrong approach.

Please check out these docs thoroughly

Getting records could look like this

GET https://[REF].supabase.co/rest/v1/countries?select=id,name,cities(id,name)

Struggling with connecting and get/post data to Supabase DB…However i think i get closer and closer.
Now i get this message:
{“message”:“No API key found in request”,“hint”:“No apikey request header or url param was found.”}
I know the url is correct and so is all the values for properties.
In other words, i have URL, I have APIKEY, I Have AUTHORIZATION but still i get the error message.

Anyone? @jared maybe?
Thanks in advance…

(FYI: Image is showing only part of “an bearer keys”

Have you tried running it in Postman?

Hi - I am really open to anything after trying for a week now…
but i dont know Postman… Can you give an example…or direct me?

Your object is configured like this:

Property: Content-Type
value: application/json

But it needs to be like this:
Content-Type: application/json

An object has property:value pairs that are defined horizontally on a single line but you’ve named the properties all “Property” or “value” as if they are read vertically.

You can see an example of this in the documentation: Setting Headers - Thunkable Docs

Yep - Got it - actually i discovered that earlier.
The thing is that it say it is missing apikey, Authorization in the request url
And i dont get thet. The URL it self is kind of neutral apart from the project name. Then i used the headers to assign
apikey: The key
Authorization: Bearer + The Key
Content-Type: application/json
But nothing works - I even user the template and also the blocks - several different times - BUT
No Success…
Any other brilliant ideas… I did build qwith APIs before and DBs but this seems to be really complex… OR … i just dont see it… ;-D

If you post an updated screenshot with the object fields fixed, someone may be able to help. I’m not sure what else to suggest for your setup.

You may not need an “apikey” property:value pair since it’s included in the “Authorization” property:value pair.

@matt_conroy Can you merge this topic with How can I connect Thunkable with Supabase since it’s a continuation of that discussion?