JavaScript SDKs & Samples - Auth0 Docs
Auth0 SDKs
Updated Auth0 SDKs to secure AI agent workflows:
Next.js
This SDK streamlines integrating Auth0 authentication and authorization services into Next.js applications. It supports:
- User authentication
- Tools for getting access tokens for supported social and enterprise identity providers
npm install @auth0/nextjs-auth0
Node.js
This library streamlines integrating Auth0’s authentication and authorization services into Node.js applications. It supports:
- User authentication
- Tools for signing up users, managing user profiles, and securing API endpoints.
npm install auth0
Auth0 Fastify SDK
This SDK streamlines integrating Auth0 authentication and authorization services into Fastify applications. It supports:
- User authentication
- Tools for getting access tokens to call first-party APIs
npm i @auth0/auth0-fastify
Auth0 AI SDKs
Auth0 AI SDKs to streamline integrating your application with popular agentic frameworks:
Auth0 AI SDK
This SDK provides base abstractions for authentication and authorization in AI applications. It supports:
- Asynchronous user authentication using the Client Initiated Backchannel Authentication (CIBA) protocol
- OpenFGA-based filter for RAG
npm install @auth0/ai
Auth0 AI Components
This library helps to set up the React components that can be used in AI applications using AI Identity for B2B. The components are styled using Tailwind CSS. It supports:
- Tools for getting access tokens for supported social and enterprise identity providers
npx @auth0/ai-components add TokenVault
Redis Store for Auth0 AI
This SDK provides a secure Redis-based data store implementation for use with the Auth0 AI SDKs. It supports:
- Securely encrypting data before storing it in Redis
- Organizing keys using namespaces
- Setting expiration times for stored data
npm install @auth0/ai-redis
Sample applications
Checkout our sample applications for JavaScript/TypeScript built with frameworks like LangGraph and Vercel AI.
A fullstack AI personal assistant with pre-configured tools that demonstrate different AI Identity for B2B features like User Authentication, Calling APIs (Gmail, Google Calendar, etc) securely using Token Vault, Human-in-the-loop interactions using Asynchronous Authorization, and using Auth0 FGA for securing RAG tools.
An AI HR assistant that provides secure access to HR documents based on complex authorization rules. This demonstrates the use of Auth0 FGA to secure RAG applications with relationship-based access control (Fine-Grained Authorization). Implemented on a Next.js application with LlamaIndex.
A full-stack AI personal assistant, powered by React and Fastify, that invokes your APIs using tool calls on a logged-in user’s behalf.
Explore our repository of standalone sample applications that showcase Auth0’s authentication and authorization capabilities in generative AI applications. Each sample demonstrates a specific AI Identity for B2B feature.
Auth0 AI SDK TypeScript Samples
Explore example applications that accompany Auth0’s JavaScript AI SDKs. These demonstrate recommended implementation patterns for the SDKs.
Guides & Tutorials
Checkout our guides for Next.js, LangChain, LlamaIndex, Vercel AI, and Genkit in JavaScript/TypeScript.