Next.js AI chatbot

// npm install react-elfsight-widget
// components/AiChatbot.tsx
"use client";
import { ElfsightWidget } from "react-elfsight-widget";
export function AiChatbot({ id }: { id: string }) {
return <ElfsightWidget widgetID={id} />;
}
// app/layout.tsx — once, for every page
// <AiChatbot id="YOUR-WIDGET-ID" />Create your AI agent for free
- 1. Enter your website
- 2. Shape your agent
- 3. Add to website
Building an AI chatbot in Next.js yourself
What you’d build and keep running
Your content as answers
The chat UI
Conversation memory
Guardrails
Leads and handoff
Transcripts and analytics
Upkeep
With Elfsight: one component
<AiChatbot id="YOUR-ID" />Learns from your website automatically
Lead forms and human handoff built in
Chat history, transcripts and analytics
Floating or embedded, styled in the editor
Free plan, no credit card
Add the AI chatbot to Next.js
Client component. Mark the wrapper with "use client" and render it from any Server Component.
Once in the root layout. A floating chat in app/layout.tsx shows on every page and survives client-side navigation.
Static export friendly. Nothing runs on your server; it works with output: "export" and on any host.
// npm install react-elfsight-widget
// components/AiChatbot.tsx
"use client";
import { ElfsightWidget } from "react-elfsight-widget";
export function AiChatbot({ id }: { id: string }) {
return <ElfsightWidget widgetID={id} />;
}
// app/layout.tsx — once, for every page
// <AiChatbot id="YOUR-WIDGET-ID" />What the agent does with no code of yours
Builds from your website
Creates a knowledge base
Shapes a personality
Prepares the first interaction
Equips with the right skills
Learns from conversations
Elfsight AI Chatbot vs building on a model API in Next.js
Time to launch
Elfsight AI Chatbot
Your own build
Knowledge
Elfsight AI Chatbot
Your own build
Chat UI
Elfsight AI Chatbot
Your own build
Leads and handoff
Elfsight AI Chatbot
Your own build
Transcripts and analytics
Elfsight AI Chatbot
Your own build
Costs
Elfsight AI Chatbot
Your own build
Upkeep
Elfsight AI Chatbot
Your own build