Switching from legacy keys (anon) to new ones (publishable)

Hey, I have a question please: What do i need to do to update the keys ? Only replace the anon key by the publishable one ? Thank you
6 Replies
ibrahim
ibrahim•23h ago
If you have migrated the keys over then yes, you replace the anon key with publishable and the service role key with secret If you have any edge functions that you are currently calling, you need to set verify-jwt as false in the config.toml or details section and manually verify the incoming request
ibrahim
ibrahim•23h ago
GitHub
supabase/examples/edge-functions/supabase/functions/_shared/jwt/def...
The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications. - supabase/supabase
younessquick
younessquickOP•22h ago
thank you so much Ibrahim, but why do I have to set verify-jwt as false ? and where can I do it please ? thanks
ibrahim
ibrahim•22h ago
The answer from supabase here https://supabase.com/docs/guides/api/api-keys is more concise
Edge Functions only support JWT verification via the anon and service_role JWT-based API keys. You will need to use the --no-verify-jwt option when using publishable and secret keys. The Supabase platform does not verify the apikey header when using Edge Functions in this way. Implement your own apikey-header authorization logic inside the Edge Function code itself.
Edge Functions only support JWT verification via the anon and service_role JWT-based API keys. You will need to use the --no-verify-jwt option when using publishable and secret keys. The Supabase platform does not verify the apikey header when using Edge Functions in this way. Implement your own apikey-header authorization logic inside the Edge Function code itself.
Understanding API keys | Supabase Docs
First-layer protection for your project's data
ibrahim
ibrahim•22h ago
You either do it inside of the config.toml file if using cli to manage edge functions, or if using the dashboard you click and edge function and next to the code tab you will see a details tab and you will see the option to turn of jwt verification
younessquick
younessquickOP•22h ago
thank you so much šŸ™‚

Did you find this page helpful?