The Auth0 Node.js SDK (package name: auth0) is a comprehensive client library for integrating with Auth0's Authentication API and Management API v2. This SDK enables server-side applications to authenticate users, manage Auth0 resources, and perform administrative operations on Auth0 tenants.
This page provides a high-level introduction to the SDK's architecture, primary components, and capabilities. For installation and setup instructions, see Installation and Quick Start. For detailed information about the SDK's dual-layer architecture and code generation workflow, see Architecture and Design.
The SDK is distributed as the auth0 package on npm. As of version 5.4.0, it requires Node.js ^20.19.0 || ^22.12.0 || ^24.0.0 and provides first-class TypeScript support with full type definitions.
| Property | Value |
|---|---|
| Package Name | auth0 |
| Current Version | 5.4.0 |
| License | MIT |
| Repository | https://github.com/auth0/node-auth0 |
| Minimum Node.js | 20.19.0, 22.12.0, or 24.0.0 |
| Module Systems | CommonJS and ES Modules |
Sources: package.json1-140
The SDK exposes three main client classes, each targeting a specific Auth0 API surface:
The AuthenticationClient provides methods for user-facing authentication operations. It implements various OAuth 2.0 flows, passwordless authentication, and database connection management.
Key capabilities:
Sources: README.md36-48 Diagram 1 from high-level architecture
The ManagementClient enables programmatic administration of Auth0 tenants. It provides access to 30+ resource-specific sub-clients, each managing a particular Auth0 entity type (users, clients, connections, actions, etc.).
Key capabilities:
Sources: README.md50-76 src/management/wrapper/ManagementClient.ts Diagram 1 from high-level architecture
The UserInfoClient retrieves authenticated user profile information using an access token. It provides a simple interface to the OpenID Connect UserInfo endpoint.
Key capabilities:
Sources: README.md78-91
The SDK supports both CommonJS (require()) and ES Modules (import) through dual compilation. The package exports are configured to automatically resolve the correct module format based on the consumption context.
Root export (auth0):
AuthenticationClient, ManagementClient, UserInfoClientManagementError, AuthApiError)HttpResponseHeadersUtils)Legacy export (auth0/legacy):
Sources: package.json14-39 src/index.ts1-7 Diagram 4 from high-level architecture
The SDK provides comprehensive TypeScript types for all request parameters, response bodies, and error scenarios.
Key exported types:
Management.* namespace: All Management API types (actions, users, clients, connections, etc.)Auth.* namespace: Authentication API request/response typesManagementError: Structured error with statusCode, message, body, and rawResponseAuthApiError: Authentication API error with error codesPage<T>: Paginated response wrapper with navigation helpersTokenQuotaBucket: Token quota information from response headersSources: src/index.ts1-7 src/lib/errors.js src/lib/models.js README.md254-274
The SDK employs a two-layer architecture for the Management API, separating auto-generated code from custom business logic.
Generated Layer:
FernClient class with HTTP infrastructureCustom Layer:
.fernignoreManagementClient wrapper extends FernClient with Auth0-specific featuresTokenProvider implements intelligent token caching with expiry managementAuthenticationClient is entirely hand-written (not generated)Sources: Diagram 2 from high-level architecture, .fernignore src/management/wrapper/ManagementClient.ts src/management/Client.ts
The SDK leverages native fetch and works across diverse JavaScript runtimes:
| Runtime | Supported Versions | Notes |
|---|---|---|
| Node.js | 20.19+, 22.12+, 24+ | Native fetch support required |
| Vercel Edge | Latest | Full support |
| Cloudflare Workers | Latest | Full support |
| Deno | 1.25+ | Full support |
| Bun | 1.0+ | Full support |
| React Native | Latest | With polyfill for fetch |
The SDK defaults to the global fetch client if present, eliminating the need for runtime-specific builds.
Sources: README.md576-587 package.json113-114 Diagram 4 from high-level architecture
Authentication:
Management:
Developer Experience:
withTimeout, withRetries, withHeaders, etc.)Sources: README.md254-575 Diagram 3 from high-level architecture, Diagram 6 from high-level architecture
The SDK provides a legacy export at auth0/legacy that maintains full backward compatibility with the v4.x API. This allows applications to migrate incrementally from v4 to v5 without requiring a complete rewrite.
For comprehensive migration guidance, including breaking changes, method name updates, and new features, see Migration Guide (v4 to v5) and Legacy Client Support.
Sources: README.md93-252 package.json28-38 package.json77
Sources: Table of contents from section numbers 1.1-1.3, 2, 3