Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
Fullstack chat agent with authentication, request credits and payments built in.

A full-stack Next.js TypeScript template focused on functionality over UI, featuring Zustand, TanStack Query, and ESLint 9 support.
Agent with Auth and Payments is a fullstack boilerplate that pairs a Next.js 15 chat interface with a LangGraph.js agents backend, bundling Supabase authentication, Stripe payments, and a credit system into a single pnpm monorepo.
Agent with Auth and Payments is a LangChain-originated GitHub template (from the langchain-ai organization) that gives developers a complete starter for an agentic SaaS product. It consists of two deployable apps: apps/web, a Next.js 15 chat UI, and apps/agents, a Node.js + TypeScript backend running LangGraph.js ReAct agents. The template outputs a fullstack application where users sign in, buy credits, chat with an AI agent, and have credits automatically deducted per conversation.
pnpm dev, pnpm build, and pnpm test controlling everything in parallel.supabase-schema.sql file creates a users table, Row Level Security policies, automatic profile creation, and performance indexes during setup.customer.subscription.created, customer.subscription.updated, and customer.subscription.deleted webhooks forwarded to localhost:3000/api/webhooks/stripe; purchased credits are stored and deducted per chat message.pnpm web:dev and pnpm agents:dev start each app independently, while pnpm dev runs both simultaneously..env.example files to .env for both apps/web and apps/agents, filling in credentials.pnpm install then pnpm dev to start both development servers.supabase-schema.sql into the Supabase SQL Editor to create the users table and security policies.stripe listen for the three subscription events, forward to the webhook endpoint, and add the webhook secret.Yes, the template requires external services. You must create a Supabase project and run the provided SQL schema, and you need a Stripe account plus the Stripe CLI to test webhook events locally.
The README's stripe listen command forwards customer.subscription.created, customer.subscription.updated, and customer.subscription.deleted to localhost:3000/api/webhooks/stripe, which updates the user's credit balance.
Yes. The web app is a standard Next.js app that can be deployed to Vercel, Netlify, or any Node.js hosting; the agents app is a separate Node.js service that can be deployed independently or containerized with Docker.
The repository is public on GitHub under the langchain-ai organization, so the source code is freely available to clone, modify, and reuse in your own projects.