Aura UI

Config

The authentication configuration for React.

Every Aura UI block reads from a single auth client, so this is the one setup step that has to happen before any component works. It creates two files: a server-side auth.ts (your Aura Auth instance) and a client-side auth-client.ts (the typed client the blocks call useSignIn, useSession, etc. through).

Installation

npx shadcn add https://aura-stack-ui.vercel.app/r/react-setup.json

Create the auth configuration file

src/lib/auth.ts
import { createAuth } from "@aura-stack/react/server"

export const auth = createAuth({
  // Add your authentication configuration here
})

Create the auth client file

src/lib/auth-client.ts
import { createAuthClient } from "@aura-stack/react"

export const authClient = createAuthClient({
  // Add your authentication client configuration here
})

What goes in createAuth

The createAuth function initializes the Aura Auth instance with configuration options for OAuth providers, session management, cookie handling, and security settings. For more details, read the Aura Auth documentation

What goes in createAuthClient

The createAuthClient function initializes the client-side Aura Auth instance that interacts with the server-side auth instance. For more details, read the Aura Auth documentation