# React Hooks Reference

> Quick reference for all @aerostack/react hooks — useAuth, useAerostack, usePresence, useSubscription, and more.

Quick reference for all hooks exported from `@aerostack/react`.

## `useAuth()`

Returns the full auth state and all auth methods.

```ts

const {
  // State
  user,            // User | null
  tokens,          // { accessToken, refreshToken?, expiresAt? } | null
  loading,         // boolean
  error,           // string | null
  isAuthenticated, // boolean

  // Methods
  signIn,                  // (email, password, turnstileToken?) => Promise
  signUp,                  // (email, password, opts?) => Promise
  signOut,                 // () => Promise
  sendOTP,                 // (identifier, type?) => Promise
  verifyOTP,               // (identifier, code, type?) => Promise
  verifyEmail,             // (token) => Promise
  resendVerificationEmail, // (email) => Promise
  requestPasswordReset,    // (email, turnstileToken?) => Promise
  resetPassword,           // (token, newPassword) => Promise
  refreshAccessToken,      // (refreshToken) => Promise<{ accessToken, ... }>
  refreshUser,             // () => Promise
  updateProfile,           // (updates) => Promise
  deleteAvatar,            // () => Promise
} = useAuth()
```

See [React SDK — Authentication](/sdk/react/auth) for full method signatures.

---

## `useAerostack()`

Access the provider context.

```ts

const {
  projectId,  // string — your project ID
  apiKey,     // string — your public API key
  baseUrl,    // string — API base URL
  realtime,   // RealtimeClient instance
  sdk,        // AerostackSDK instance (limited client-side API)
} = useAerostack()
```

The `realtime` object is the `RealtimeClient` — use it for channel subscriptions. See [React SDK — Realtime](/sdk/react/realtime) for the full API.

---

## Types

```ts

  User,
  AuthTokens,
  AuthState,
  ProfileUpdate,
} from '@aerostack/react'
```

| Type | Description |
|------|-------------|
| `User` | `{ id, email, name?, avatar_url?, emailVerified, createdAt?, customFields? }` |
| `AuthTokens` | `{ accessToken, refreshToken?, expiresAt? }` |
| `AuthState` | `{ user, tokens, loading, error }` |
| `ProfileUpdate` | `{ name?, avatar_url?, avatar_image_id?, customFields? }` |
