New Supabase Auth config for SB Production DB ? How to

Hello all,

I’m setting up a production database in supabase.
So far I’ve been using the 'Supabase Auth’ plugin,

But now I’d like to condition whether to use the Supabase PROD DB if the weweb environment is in production,
or use Supabase Test Database if weweb is NOT in production.

Is there a way to do that ?

Hi Matt :waving_hand:

This is an interesting question, I’m not sure you are able to change the database connection if you are using our supabase plugin.

Maybe you can create this functionality with some manual if statements and a direct REST API system.

I’ll ask the team to see if they have other ideas.

Hi Agustin,

That’s what I was thinking, but i’ve read in this post that I could use those line to change the supabase url and anon key

await wwLib.wwPlugins.supabaseAuth.load(<instance-url>, <public-api-key>)
wwLib.wwPlugins.supabase.syncInstance()

Not sure how to use it since it doesn’t work for me yet.

Does that still work ? And how could I use it ?