Auth SDKs

Authentication SDKs for integrating Transactional Auth into your applications.

Transactional Auth provides OpenID Connect-based authentication as a service. Rather than building your own login flows, token management, and session handling, you can integrate one of our official SDKs and get production-ready auth in minutes. Choose the SDK that matches your stack.

Which SDK Should I Use?

Use CaseSDKPackage
Full-stack Next.js app (App Router, Server Components, Middleware)Auth for Next.js@usetransactional/auth-next
Backend API (Express, Fastify, any Node.js server)Auth for Node.js@usetransactional/auth-node
Single-page application (React, Vite)Auth for React@usetransactional/auth-react
Better Auth framework integrationBetter Auth Plugin@usetransactional/better-auth

Architecture

Transactional Auth acts as an OpenID Connect (OIDC) identity provider. Here is how it works at a high level:

  • OIDC-compliant - Transactional Auth implements the OpenID Connect specification, so it works with any OIDC-compatible library or framework.
  • SDKs handle the OAuth 2.0 / OIDC flow for you - Each SDK abstracts the authorization code flow, token exchange, session management, and token refresh so you do not need to implement these yourself.
  • Tokens are JWTs signed by Transactional Auth - Access tokens and ID tokens are standard JSON Web Tokens that can be verified using the JWKS endpoint published by your Transactional Auth domain.
  • Platform-specific abstractions - Each SDK provides the right abstraction for its platform: middleware and server functions for Next.js, hooks and context providers for React SPAs, and Express-compatible middleware for Node.js backends.

Quick Comparison

Featureauth-nextauth-nodeauth-reactbetter-auth
Token verificationServer-sideServer-sideClient-sideServer-side
Route protectionMiddleware + HOCExpress middlewareAuthGuard + HOCBetter Auth built-in
User management APIVia server functionsFull management clientN/A (client-only)Better Auth built-in
SSR supportFullN/AN/AFull
PKCEAutomaticN/AAutomaticAutomatic

Getting Started

To integrate Transactional Auth into your application:

  1. Create an application in the Transactional dashboard. Navigate to the Auth module and create a new application.
  2. Note your Client ID and Client Secret from the application settings page. The Client Secret is only shown once, so store it securely.
  3. Configure your redirect URI in the application settings. This is the URL that Transactional Auth will redirect to after authentication (e.g., http://localhost:3000/api/auth/callback for Next.js).
  4. Install the appropriate SDK for your platform using npm, pnpm, or yarn.
  5. Follow the SDK-specific guide linked in the table above for detailed setup instructions, code examples, and configuration options.