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: next 14 or 15 with the App Router for /nextjs, react 18 or 19 for /components and /react, and express 4 for /express. Each is optional; install only the one you use.
  • Your environment's client ID and API key (see credentials).

Install the package#

Terminal

npm install @3een/auth
# or
yarn add @3een/auth

Entry points#

Import from the entry point that matches where the code runs.

ImportRuns inWhat it provides
@3een/auth/nextjsNext.js serverhandleAuth, authMiddleware, getAuth, getUser, getAccessToken, getAccessTokenFromRequest, requireAuth, has, verifySessionToken, verifyWebhook
@3een/auth/componentsBrowser (Client Components)SignIn, SignInButton, SignUpButton, UserButton, OrganizationSwitcher, SignedIn, SignedOut, Protect, useSession, signOut
@3een/auth/expressExpress serverauthMiddleware, requireAuth, requirePermission, handleCallback, handleSignOut, has, verifySessionToken, verifyWebhook
@3een/authAny serverAuthClient, verifySessionToken, verifyWebhook, has, shared types and constants
@3een/auth/reactBrowserAuthProvider, 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.