deleteUser()

Delete a user. Requires a service_role key.

This function should only be called on a server. Never expose your service_role key in the browser.

1const { data: user, error } = await supabase.auth.api.deleteUser(
2  '715ed5db-f090-4b8c-a067-640ecee36aa0'
3)

Parameters#

  • uidrequired
    string

    The user uid you want to remove.

Notes#

  • Requires a service_role key.
  • This function should be called on a server. Never expose your service_role key in the browser.

Examples#

Remove a user completely.#

1const { data: user, error } = await supabase.auth.api.deleteUser(
2  '715ed5db-f090-4b8c-a067-640ecee36aa0'
3)