# User

A MinChat user is a person who uses your app or website. they are represented as a JSON object.

Minchat is designed to prioritize the idea that user data belongs to the user, and we only keep it in order to provide an efficient chat service. This means that: MinChat only collects the data necessary for its functionality, and nothing more.&#x20;

```javascript
{
        username: "mercy" ,
        name: "Mercy Wells" ,
        avatar: "urltoavatar.com/mercyavatar.jpg"
}
```

<table><thead><tr><th width="167">Field</th><th width="169">Type</th><th width="96">state</th><th>Description</th></tr></thead><tbody><tr><td><code>username</code></td><td><code>string</code></td><td><em>required</em></td><td>Unique username of the user in your database.</td></tr><tr><td><code>name</code></td><td><code>string</code></td><td><em>required</em></td><td>Name of the user.<br>Example: <code>"Joshua"</code> </td></tr><tr><td><code>avatar</code></td><td><code>string | File</code></td><td><em>optional</em></td><td>the avatar of the user. A Jpeg, png or webp file, with maximum size of 25mb or a url to an image file</td></tr><tr><td><code>metadata</code></td><td><code>json object</code></td><td><em>optional</em></td><td>an optional key value pair for any additional user information such as email, age, or <code>JSON</code> formatted string. accepts string,number and boolean values</td></tr><tr><td><code>lastActive</code></td><td><code>Date</code></td><td>-</td><td>shows the date and time when the user was last </td></tr></tbody></table>
