How can I connect Thunkable with Supabase

Yes great - But before i do that… No i have the headers in the template …
And those look OK right ??

1 Like

These look good to me. Did that work for you?

No it did not
I have tried a million version of URLs to see if i can get anything to work.
But no, Either the response is empty or refering to the message;
{“message”:“No API key found in request”,“hint”:“No apikey request header or url param was found.”}

So i am stuck… :frowning:

Wait. Why do you need an api key? That plus the bearer token seems like a little extra

1 Like

Thats my question to…
I dont get it…
And where do my selection (for GET) GO?
Or the same for POST…
Strange

hopefully this can help you get started

an example of a GET to read all rows
https://x.thunkable.com/copy/c29456ec15d6d91887d595e1400c1df4


1 Like

Ok i’ll check this out. I believe i tried it allready
But i do that and let you know…

You can actually test my example and see that it works

I am using a table without row level security turned on. It’s identical when rls is turned on but you’d probably pass a user token and not the public key

i can confirm it works if:

  1. Bearer is NOT used before the key in Authorization - Stick with the key only
  2. Disable the Row Level Security (RLS)
    Those two actions in enough to get you going and test. You would probably want the RLS enable at a certain point but i have not tried that one yet.

Thank you @jared for the solution. works fine now. Need to figure out the sorting …
Small question in addition
In supabase -H stands for “headers” but how shall i interpret “-d” Like in “-d ‘[{ “some_column”: “someValue” }, { “other_column”: “otherValue” }]’”
It is related to the querie but i dont know where to put it in the call - Or is it under Header any ways ?

-d is for body

1 Like

Hey!

-d would be the body of the request that you are sending. this is also typically reserved for sending data in a POST/PATCH request. Not useful to GET data

For supabase, using PostgREST, you’ll send your query constraints in the URL itself

https://x.thunkable.com/projectPage/652308d92ecc34478bef887d
the above example demo’s how to GET data from your supabase DB using a simple RLS policy of authenticated users only.

i will include a screenshot of the relevant blocks below

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.