auth-js
auth-js copied to clipboard
Allow createClient() to use user's jwt without the need for anon key
Feature request
Is your feature request related to a problem? Please describe.
Allow createClient() to use user's jwt so that the client does not need anon key:
const supabase = createClient(url, user's jwt);
Currently this will not work for Realtime which gives repeated WebSocket connection failed errors.
Just to provide more context, my web client gets the user's jwt by signing in indirectly through my own custom API server, so it does not need the anon key to call Supabase API.
Describe the solution you'd like
Allow createClient() to use user's jwt without the need for anon key.
Describe alternatives you've considered
Currently the solution is to use anon key for createClient(), followed by:
supabase.auth.setAuth(user's jwt)