Get started
Installation
Install @3een/auth and pick the entry point for your framework.
Requirements#
- Node.js 18 or later, and a 3een project with an environment (development or production).
- Peer dependencies, as the package declares them:
next14 or 15 with the App Router for/nextjs,react18 or 19 for/componentsand/react, andexpress4 for/express. Each is optional; install only the one you use. - Your environment's client ID and API key (see credentials).
Install the package#
npm install @3een/auth
# or
yarn add @3een/authEntry points#
Import from the entry point that matches where the code runs.
| Import | Runs in | What it provides |
|---|---|---|
@3een/auth/nextjs | Next.js server | handleAuth, authMiddleware, getAuth, getUser, getAccessToken, getAccessTokenFromRequest, requireAuth, has, verifySessionToken, verifyWebhook |
@3een/auth/components | Browser (Client Components) | SignIn, SignInButton, SignUpButton, UserButton, OrganizationSwitcher, SignedIn, SignedOut, Protect, useSession, signOut |
@3een/auth/express | Express server | authMiddleware, requireAuth, requirePermission, handleCallback, handleSignOut, has, verifySessionToken, verifyWebhook |
@3een/auth | Any server | AuthClient, verifySessionToken, verifyWebhook, has, shared types and constants |
@3een/auth/react | Browser | AuthProvider, useAuth, Protect and token helpers (see the limitation below) |
SDK version#
These pages document @3een/auth 1.2.0, the current released SDK. The examples marked type-checked are compiled against that source, so a renamed function or option fails the check instead of reaching these pages. If your registry offers an older version, some exports shown here (for example the embedded SignIn, added in 0.9.0) will be missing.