Today I received a message from Supabase they will remove the use of the Anon Key.
If I check the request made by my project to the supabase /rest/v1 in the Log file, the request are made by the Anon key.
In the WeWeb Supabase Plugin I’ve tried to change the ‘Public Api Key’ to a new ‘Publishable Key’, but this results in a ‘Invalid Supabase Auth configuration.’-error in WeWeb.
How do I have to solve this issue, as the Anon key will be removed 8th of april, it’s quite urgent.
I think we may not be using the anon key in projects where the plugin was configured with the “Connect Supabase” button but I’m not 100% sure. Let me check with the team and get back to you on that one
This does not affect normal Data API usage. Accessing data via /rest/v1/your_table or any client library will continue to work exactly as they do today.
For WeWeb apps in production using the Supabase plugin(s), there will be no breaking change.
No action is required on your side. The anon key is not used in your production apps.
2. Possible impact inside the WeWeb editor
What might be affected by the Supabase breaking change is your experience inside the WeWeb editor.
Currently, our Supabase plugin(s) use the anon key to fetch your database schema (tables and columns) so you can create collections inside WeWeb. We’ll be updating the plugin to use the service_role key instead.
Depending on how you configured your Supabase plugin(s), you may need to:
Reconnect to Supabase, and/or
Make sure the Service role key is filled in the “Custom” configuration
You should see a popup if there’s an action required (to provide a Service Role Key). Otherwise, it should work directly without any additional steps.
If you’re having trouble accessing data through a collection, or if you’re encountering any other issues, could you please contact our support team so they can take a closer look?
Can we create and use a secret key instead of the service role, e.g. sb_secret_… instead of the legacy service_role key? For example, going to Supabase and then Project Settings → API Keys → API Keys tab here → Create new API key?
I’m a bit concerned about exposing the service role key like that… Isn’t it a major security risk? Considering the service role key bypasses all RLS it doesn’t look like a great idea.
I understand your concern. However, the service role key is only used within the editor to fetch metadata from the Supabase project. It’s never exposed or used in the published app.
Hi Tamara and thanks for the clarification. I received an ethical hacking last week from a cybersecurity team so I’m trying to cover all the possible loopholes.
Does this change also means the `anon` key won’t be exposed anymore as hardcoded in the exported code?
The anon key is designed to be public, and it’s included in the exported code, that’s how Supabase works. It’s required to make client-side requests to Supabase from your web app. You can learn more in the Supabase docs about API keys Understanding API keys