Add User Authentication
This guide helps you integrate user authentication with popular providers so users only access their own Tambo threads and messages.
Learn how to enable per-user authentication so users of your application only access Tambo threads and messages that belong to them.
Tambo supports authentication through any OAuth 2.0 provider. Choose your authentication provider below to get started with a step-by-step integration guide.
Available Providers
Auth.js
Learn how to integrate Tambo with Auth.js using Google OAuth as an example.
Auth0
Step-by-step guide for integrating Tambo with Auth0 authentication.
Clerk
Complete example of using Tambo with Clerk's authentication system.
Supabase
Integration guide for Supabase Auth with Tambo in Next.js applications.
Neon
How to use Tambo with Auth.js and Neon PostgreSQL database integration.
WorkOS
Enterprise-grade authentication with WorkOS and Tambo integration.
Better Auth
Modern authentication toolkit with built-in support for multiple providers and plugins.
Before You Begin
All authentication integrations follow the same pattern:
- Set up your auth provider - Configure your OAuth application with the provider
- Get the user token - Retrieve the JWT token from your auth provider
- Pass token to Tambo - Provide the token to
TamboProvidervia theuserTokenprop - Configure verification - Set up JWT verification in your Tambo project settings
For a deeper understanding of how Tambo authentication works, see the User Authentication concept.
Common Integration Pattern
All provider guides follow this basic structure:
"use client";
import { TamboProvider } from "@tambo-ai/react";
export default function Layout({ children }: { children: React.ReactNode }) {
const userToken = useUserToken(); // Provider-specific hook
return <TamboProvider userToken={userToken}>{children}</TamboProvider>;
}The main difference between providers is how you retrieve the userToken. Each guide shows both server-side and client-side approaches.