Aura Auth
API ReferenceServer

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.

On this page