Learn how to sign in, sign up, authenticate and resume sessions with the SurrealDB Swift SDK.
SurrealDB supports a number of methods for authenticating users and securing the database. The Swift SDK exposes these through signin, signup, authenticate and invalidate.
Signing in
The signin method accepts a credentials enum describing the level you wish to authenticate at.
Root user
let tokens = try await client.signin(.root(username: "root", password: "root"))