api
The api object is the programmatic, server-side entry point for Aura Auth — sign-in, sign-up, session management, and sign-out without going through HTTP handlers.
Signature
export interface AuthInstance<DefaultUser extends User = User, SignUpSchema extends SchemaTypes = ZodObject<any>> {
api: AuthAPI<DefaultUser, SignUpSchema>
}auth.api is the programmatic execution engine of @aura-stack/auth — a type-safe interface for every authentication workflow (sign-in, sign-up, session management, sign-out) without constructing HTTP requests yourself. It's one of the three top-level properties returned by createAuth, alongside handlers and jose.
These are the only functions exposed on auth.api. Internal implementation details of the OAuth flow — such as building the
authorization redirect or handling the provider callback — are not part of this surface. See OAuth Authorization
Flow for how those work internally.
signIn
Signs in a user with a built-in or custom OAuth provider.
signInCredentials
Signs in a user with a username/email and password.
signUp
Registers a new user.
getSession
Returns and verifies the current user's session.
updateSession
Updates the current user's session data.
isProviderConnected
Verifies if a user is connected to a specific OAuth provider.
getProviderTokens
Retrieves the tokens for a specific OAuth provider.
getAccessToken
Retrieves the access token for a specific OAuth provider.
refreshUserInfo
Refreshes the user's information from the OAuth provider.
disconnectProvider
Disconnects the user from a specific OAuth provider.
revokeToken
Revokes the token for a specific OAuth provider.
signOut
Signs out the current user and invalidates the session.