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 Case | SDK | Package |
|---|---|---|
| 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 integration | Better 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
| Feature | auth-next | auth-node | auth-react | better-auth |
|---|---|---|---|---|
| Token verification | Server-side | Server-side | Client-side | Server-side |
| Route protection | Middleware + HOC | Express middleware | AuthGuard + HOC | Better Auth built-in |
| User management API | Via server functions | Full management client | N/A (client-only) | Better Auth built-in |
| SSR support | Full | N/A | N/A | Full |
| PKCE | Automatic | N/A | Automatic | Automatic |
Getting Started
To integrate Transactional Auth into your application:
- Create an application in the Transactional dashboard. Navigate to the Auth module and create a new application.
- Note your Client ID and Client Secret from the application settings page. The Client Secret is only shown once, so store it securely.
- 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/callbackfor Next.js). - Install the appropriate SDK for your platform using npm, pnpm, or yarn.
- Follow the SDK-specific guide linked in the table above for detailed setup instructions, code examples, and configuration options.