# Register a user

To register a user, call **`MBAuth.registerUser(withName:surname:…)`**.

{% hint style="info" %}
The fields, name , surname , email and password are required, while the other are optional.&#x20;

The field data is an arbitrary object (array or dictionary) representing additional data that you want to pass when registering the user. It will be returned when retrieving the profile.
{% endhint %}

```swift
MBAuth.registerUser(withName: "name",
                    surname: "surname",
                    email: "email",
                    password: "password",
                    phone: "1234567890",
                    image: nil,
                    data: nil, success: {
}, failure: { error in
            
})
```
