SurrealDB Docs Logo

Enter a search query

.SignIn()

Signs in to a root, namespace, database or scope user.

Method Syntax
await db.SignIn(credentials)

Arguments

ArgumentsDescription
credentials required

Variables used in a signin query.

Example usage

// Sign in to authentication `db` using the root user authData := &surrealdb.Auth{ Username: "root", // use your setup username Password: "root", // use your setup password } token, err := db.SignIn(authData) if err != nil { panic(err) }

You can invalidate the authentication for the current connection using the Invalidate() method.

On this page

© SurrealDB GitHub Discord Community Cloud Features Releases Install