Skip to content

authSubstore

Exposes the current authentication state. The SDK populates this substore automatically — you do not call a login method directly; authentication is handled by the underlying session layer.

Table of contents


user

user: TUser | undefined

The authenticated user object, or undefined when not logged in.

TUser is a Zod-inferred type from the user schema and includes standard identity fields (e.g., id, name, email). When the session has not yet resolved, user is undefined; distinguish this from a logged-out state by also checking isAuth.

Related


isAuth

isAuth: boolean

Whether the current user is authenticated.

true when user is defined and the session is active, false otherwise. Use this as the primary gate for features that require authentication (e.g., draft saving).

Related