Skip to main content

Delete User

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.

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

Parameters#

  • uidrequiredstring

    The user uid you want to remove.

  • jwtrequiredstring

    A valid JWT. Must be a full-access API key (e.g. service_role key).

Examples#

Remove a user completely.#

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