fetch calls have a backend assigned to the request, this means that libraries which make fetch calls will need to have their
fetch calls modified to include the correct backend.
Luckily supabase-js accepts a custom
fetch implementation, which means we can make it work within Fastly.
To do this, we would find our supabase API URL (for example mine is
https://impcjmexnuizjbxozwhm.supabase.co) and create a Fastly backend with this as the address and name the backend
supabase. Then in our code when we create our supabase client, we would supply our own
fetch implementation which configures the request to use the
supabase backend like so:
That’s it, we can now use supabase within Fastly Compute@Edge!