Skip to Content
Clerk logo

Clerk Docs

Ctrl + K
Go to clerk.com

createUser()

Creates a user. Your user management settings determine how you should setup your user model.

Any email address and phone number created using this method will be automatically marked as verified.

CreateUserParams

NameTypeDescription
externalId?stringThe ID of the user you use in your external systems. Must be unique across your instance.
emailAddress[]?stringEmail addresses to add to the user. Must be unique across your instance. The first email address will be set as the users primary email address.
phoneNumber[]?stringPhone numbers that will be added to the user. Must be unique across your instance. The first phone number will be set as the users primary phone number.
username?stringThe username to give to the user. Must be unique across your instance.
password?stringThe plaintext password to give the user.
firstName?stringThe user's first name.
lastName?stringThe user's last name.
publicMetadata?Record<string, unknown>Metadata saved on the user, that is visible to both your Frontend and Backend APIs.
privateMetadata?Record<string, unknown>Metadata saved on the user that is only visible to your Backend API.
unsafeMetadata?Record<string, unknown>Metadata saved on the user, that can be updated from both the Frontend and Backend APIs. Note: Since this data can be modified from the frontend, it is not guaranteed to be safe.

Last updated on September 8, 2023

What did you think of this content?

Clerk © 2023