# Create a user

A basic user account in Adamite just needs an email and a password.

```javascript
await adamite().auth().createUser("email@domain.com", "password");
```

Once you call the `createUser` method, and the user account is created, the user will be automatically signed in to that account.

## Storing additional user data

The Adamite authentication system only stores basic information about an account, such as its email address, when it was last logged in, etc. To store additional information about a user, we suggest creating a `users` table in the database. To make this process easier, we let you provide a post-registration callback where you can create additional user data in the database.

```javascript
await adamite()
  .auth()
  .createUser("email@email.com", "password", async (user) => {
    await adamite()
      .database()
      .collection("users")
      .create({ id: user.id, name: "John Smith", picture: "..." });
  });
```

{% hint style="info" %}
The user won't be signed in to their new account until the post-registration callback resolves. This allows you to safely assume user data exists in the database once a user is logged in assuming you create that data in the post registration callback.
{% endhint %}

## Prevent automatic login

If you'd like to create an account without automatically logging the user in, you can pass a fourth parameter to the `createUser` method to bypass this functionality.

```javascript
await adamite()
  .auth()
  .createUser("email@email.com", "password", null, true);
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://adamite.gitbook.io/docs/sdk/authentication/create-a-user.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
