[Editor] Staging and Production credentials handling

Hello, I know there was a thread about changing credentials for staging vs prod, e.g Supabase instances. Is there a sustainable way to do this? I was thinking, at least for the bindable values, whether there is a flag in the editor that could be something like “staging” true or something. This way you could do this conditionally, at least like this.

You have the environment under the browser context

Capture d’écran 2024-02-28 à 12.11.34

Would this also do “staging”?

Yes, the possible values are

  • editor
  • staging
  • preview (production without custom domain)
  • production (production with custom domain)

How about the Supabase credentials for example? Would that be possible to be “bindable”? Or is it already? I haven’t checked the setup in quite some time.

Not yet. We could make it bindable but I think it’s part of a larger discussion we have around environment variables.

I dont want to make it bindable because it could prevent us to change the way it work, if we want to introduce a new kind of secure field to manage credentials.

I know it’s a blocker in the meantime as there is now way to configure a different URL and public key by environment so it should be prioritised asap imo, I will discuss it with the product team :slight_smile:

Edit : Actually, we cant make it bindable because we need them also in the backend when checking the page access, and formula can be evaluated only in the frontend, so we will have to release this new feature to allow such use case (different instance per environment)

1 Like

How would you suggest using a Supabase Staging enviroment meanwhile? I can’t seem to find any sustainable way of doing this, is there some pattern you thought of meanwhile you were updating the plugin? Is there any ETA?

I think this relates pretty much to this post here: Supabase Test vs Live Database (if possible) - #9 by julian

any update is highly appreciated!

Hi there, no ETA yet. As mentioned by Alexis a couple of weeks ago, it’s a topic that requires some attention and there are ongoing discussions with the product team.

So what’s the solution? I’m asking, in particular, for Supabase configurations.

Do we change the API URLs before hitting publish?

https://community.weweb.io/t/supabase-switch-between-production-and-staging-in-one-click