Auth Admin
- Any method under the
supabase.auth.admin
namespace requires aservice_role
key. - These methods are considered admin methods and should be called on a trusted server. Never expose your
service_role
key in the browser.
import { createClient } from '@supabase/supabase-js'
const supabase = createClient(supabase_url, service_role_key, {
auth: {
autoRefreshToken: false,
persistSession: false
}
})
// Access auth admin api
const adminAuthClient = supabase.auth.admin