signUp lets you create user accounts for your web app. This API will return a promise that gets resolved once the user account has been created.
userbase.signUp({ username, password, email, profile, rememberMe = 'session' })
.then((user) => {
// user account created
})
.catch((e) => console.error(e))
Parameters
-
username [string | Len: 1-50] - The username for the account to be created.
-
password [string | Len: 6-1000] - The password for the account to be created.
-
email [string | optional] - The email for the account to be created.
-
profile [object | optional | Key Len: 1-20 | Val Len: 0-1000 | Keys: 1-100] - A place where to store some information about the account to be created. All keys and values must be strings.
-
rememberMe [string | optional] - The persistence mode for the user's session. Valid values are 'local', 'session', and 'none'. When set to 'local', the session persists even after the browser window gets closed. When set to 'session', the session persists until the browser window gets closed. And 'none' disables session persistence completely. Defaults to 'session'.
Result
-
user [object] - Contains information about the new user.
- username [string] - The user's username.
- email [string] - The user's email.
- profile [object] - The user's profile.
Notes
-
The user's password is never sent to the server. A hash gets computed client-side, and only the hash is transmitted and stored server-side.
-
The username, email, and profile are not end-to-end encrypted. They are encrypted in transit and at rest, but you will be able to see this information in the Admin panel.
Errors
- ParamsMustBeObject
- UsernameAlreadyExists
- UsernameCannotBeBlank
- UsernameMustBeString
- UsernameTooLong
- PasswordCannotBeBlank
- PasswordTooShort
- PasswordTooLong
- PasswordMustBeString
- EmailNotValid
- ProfileMustBeObject
- ProfileCannotBeEmpty
- ProfileHasTooManyKeys
- ProfileKeyMustBeString
- ProfileKeyTooLong
- ProfileValueMustBeString
- ProfileValueTooLong
- RememberMeValueNotValid
- TrialExceededLimit
- AppIdNotSet
- AppIdNotValid
- UserAlreadySignedIn
- ServiceUnavailable