This may seem very ignorant, but I am not sure how to do it.
When interacting with supabase in terminal for a vue.js app for example, all the supabase documentation shows you how to do basically anything from having your own functions, triggers, sending backend emails etc… done from the CLI.
But on Weweb, only the plugin is available to me (sign up, sign in, select, insert, upsert etc…), and trying to use javascript to communicate with supabase for anything else that is more complex will expose my key.
Could you please steer me in the right direction?
Many thanks in advance.
Edit: So, I think I should be using the REST API plugin. I will reply to myself and describe how to do it for future users.
Many thanks for your word of caution, that is something that I would have overlooked.
So, after some digging I understand that I can install the supabase CLI on my local machine, and then link it to a project that I have previously made online (which is the one I use with WeWeb). Then, from the command line I can create custom edge functions like sending custom emails with a third party app etc…
Basically, the CLI gives you full control of your supabase project which is as expected. However, this requires that I host my own linux server with supabase and connect it to WeWeb somehow. And then from WeWeb, get a workflow to somehow tell supabase to execute the function. Hmm.
My usecase: I would like to use custom edge functions in supabase. If a user clicks a button, I want to be able to send an email. There is the weweb email plugin, yes, but something like sending a magic link or custom invitation requests is more obscure and weweb email would not be useful in this case. I understand that this is a Supabase issue, not a Weweb issue - but I wouldn’t know how to make a button that sends an email without using REST for example. So not sure where to go from there.
Hopefully this gives you a good anecdote for when you decide what to include in your Supabase tutorials
You need to use CLI on your machine indeed, you sign in with your credentials, you write and deploy your Edge Function. After that you can use the Supabase SDK instance which WeWeb (not officially) provided (this is soon gonna be deprecated for a newer version 2).
Yes I guess it should works. And as the v1 and V2 signature looks similar it should still work after we upgrade to the v2. But I will note to include a new edge function action in our supabase plugin for the next rework!
Upgrade to v2 is done but we will have to communicate to people doing custom code with supabase so they can update their project before the release and we still have many new toys to implement we would like to release everything together
If it take too much time we will probably split in two releases like we did for Xano, so we can ensure supabase will receive an update this month with the v2 of the sdk!