inviteUserByEmail Service_Role_Key

In the Documentation -- inviteUserByEmail mentions that it requires the service_role key.

Based on the type definition, I don't understand how I would pass the service_role key to the function. Or maybe I'm misunderstanding how the service_role key is applied?

Also, for context, this is inside an edge function. So I believe I should have access to SUPABASE_SERVICE_ROLE_KEY I just don't understand how to apply it.

const { data: user, error } = await supabaseClient.auth.api.inviteUserByEmail(
    email,
  );
unknown.png
Sends an invite link to an email address.
Was this page helpful?