Skip to main content

createUser()

Creates a new user.

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

const { data: user, error } = await supabase.auth.api.createUser({
name: 'Yoda'
})

Parameters#

  • attributesrequiredUserAttributes

    The data you want to create the user with.

Notes#

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

Examples#

Create a new user.#

const { data: user, error } = await supabase.auth.api.createUser({
name: 'Yoda'
})