client.auth.signUp
Register a new user account.
Signature
class Client {
auth: {
signUp(input: { email: string; password: string; name?: string }): Promise<{ user: AuthUser; session: AuthSession }>
}
}
Parameters
| Name | Type | Required | Notes |
|---|---|---|---|
| string | yes | User email address |
| string | yes | Min 8 characters |
| string | no | Display name |
Throws
| Error | Condition |
|---|---|
| Invalid email or weak password |
| Email already registered |
Examples
const { user, session } = await bf.auth.signUp({
email: 'alice@example.com',
password: 'secure-pass-123',
name: 'Alice',
})
console.log(`Created ${user.id}, session ${session.token}`)
Pitfalls
- Email verification — depending on auth provider config, the user may need to verify their email before signing in
- Session returned — the user is automatically signed in on sign-up
See also
{auto-injected}
Tested against
{auto-injected}