BlueForge Docs

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

NameTypeRequiredNotes
email
stringyesUser email address
password
stringyesMin 8 characters
name
stringnoDisplay name

Throws

ErrorCondition
ValidationError
Invalid email or weak password
ConflictError
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}