NextAuth SDK
Integrate your Next.js applications with the ChatBotKit platform in a whole new way with our NextAuth.js integration. Specifically designed to work seamlessly with our Partner API, this integration simplifies user embedding, enabling you to create more personalized and robust applications.
Key Features
- Tailored for Next.js: Our NextAuth.js integration is built specifically for seamless integration into your Next.js applications, providing efficient user embedding.
- Partner API Integration: This integration is designed to work hand-in-hand with our Partner API, further enhancing your capability to build SaaS solutions on top of ChatBotKit.
- Easy Setup: With a straightforward installation process and intuitive configuration, getting started with our NextAuth.js integration is a breeze.
Getting Started
-
Installation: Add the integration to your project using npm:
npm install @chatbotkit/nextauth
-
Configuration: Create a
nextauth.config.js
file in your project root directory and add the following code:const { ChatBotKitPartnerAdapter, ChatBotKitEmailProvider, MemoryStore, } = require('@chatbotkit/nextauth') const nextAuthConfig = { adapter: ChatBotKitPartnerAdapter({ secret: process.env.CHATBOTKIT_API_SECRET, store: new MemoryStore(), }), providers: [ChatBotKitEmailProvider({})], session: { strategy: 'jwt', }, callbacks: { async session({ session, token }) { session.user = token.user return session }, async jwt({ token, user }) { if (user) { token.user = user } return token }, }, pages: { signIn: '/signin', verifyRequest: '/verify', }, debug: !!process.env.DEBUG, }
-
Usage: Use the configuration file to initialize the NextAuth.js routes as you normally would.
Dive Deeper
Ready to explore more? Our comprehensive NextAuth.js integration documentation provides everything you need to get started with ChatBotKit's NextAuth.js integration. For a complete example of the integration in use, visit our GitHub repository.
Join us in the era of conversational AI. Empower your Next.js applications with ChatBotKit's NextAuth.js integration - because your applications deserve the best!