deleteUser()

Delete a user. Requires a service_role key.

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

Parameters#

  • idrequired
    string

    The user id you want to remove.

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

Notes#

  • The deleteUser() method requires the user's ID, which maps to the auth.users.id column.

Examples#

Removes a user#

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