Skip to content

Search is only available in production builds. Try building and previewing the site to test it out locally.

@reactor/auth — authclient

@reactor/auth


@reactor/auth / AuthClient

Defined in: client.ts:42

Authentication client for Reactor.

Handles user authentication, session management, token refresh, and multi-tab sync.

new AuthClient(ctx, options?): AuthClient

Defined in: client.ts:54

RequestContext

AuthClientOptions = {}

AuthClient

readonly apiKeys: ApiKeysClient

Defined in: client.ts:52

API keys client


readonly orgs: OrgsClient

Defined in: client.ts:48

Organizations client


readonly permissions: PermissionsClient

Defined in: client.ts:50

Permissions client

confirmPasswordReset(params): Promise<Result<void>>

Defined in: client.ts:349

Confirm a password reset with the token and new password.

ConfirmPasswordResetParams

Promise<Result<void>>


deleteUser(): Promise<Result<void>>

Defined in: client.ts:424

Delete the current user’s account.

Promise<Result<void>>


getAccessToken(): string | null

Defined in: client.ts:417

Get the access token for making authenticated requests. Used internally by the request context.

string | null


getSession(): Promise<any>

Defined in: client.ts:250

Get the current session. Refreshes automatically if near expiry.

Promise<any>


getUser(): Promise<Result<any>>

Defined in: client.ts:259

Get the current user. Fetches from server if not cached.

Promise<Result<any>>


initialize(detectUrl?): Promise<void>

Defined in: client.ts:103

Initialize the auth client. Loads session from storage and handles URL tokens.

boolean = true

Promise<void>


onAuthStateChange(callback): AuthStateSubscription

Defined in: client.ts:409

Subscribe to auth state changes.

AuthStateChangeCallback

AuthStateSubscription


refreshSession(): Promise<Result<Session>>

Defined in: client.ts:359

Manually refresh the session.

Promise<Result<Session>>


requestPasswordReset(params): Promise<Result<void>>

Defined in: client.ts:340

Request a password reset email.

RequestPasswordResetParams

Promise<Result<void>>


resendVerification(params): Promise<Result<void>>

Defined in: client.ts:333

Resend email verification.

ResendVerificationParams

Promise<Result<void>>


setSession(session): Promise<void>

Defined in: client.ts:402

Set the session manually (for SSR scenarios).

Session

Promise<void>


signIn(params): Promise<Result<{ session: Session; user: User; }>>

Defined in: client.ts:204

Sign in with email and password.

SignInParams

Promise<Result<{ session: Session; user: User; }>>


signOut(): Promise<Result<void>>

Defined in: client.ts:231

Sign out the current user. Revokes the refresh token server-side.

Promise<Result<void>>


signUp(params): Promise<Result<{ session: Session; user: User; }>>

Defined in: client.ts:177

Sign up a new user.

SignUpParams

Promise<Result<{ session: Session; user: User; }>>


updateUser(params): Promise<Result<User>>

Defined in: client.ts:285

Update the current user’s profile.

UpdateUserParams

Promise<Result<User>>


verifyEmail(params): Promise<Result<{ verified: boolean; }>>

Defined in: client.ts:306

Verify an email address with a token.

string

Promise<Result<{ verified: boolean; }>>