For docs sites built with Next.js
Add Ask AI to your Next.js docs site
Add an Ask AI chatbot to a documentation site built with Next.js. Works with App Router and Pages Router. Readers get source-cited answers from your indexed content, in their language.
14-day freeSelf-serveLive in 15 min
Biel.ai chatbot
Powered by biel.ai
Assistant
Hi! how can I help you?
Suggested questions
enable dark mode
Assistant
To enable dark mode for Biel.ai on your website, follow these steps:
- Modify your website’s main HTML file.
- Add the attribute
data-theme="dark"to the<html>tag.
html
<html data-theme="dark">
<!-- Your existing HTML content -->
</html>This change activates the dark mode styling for Biel.ai…
AI-generated answers may contain errors. Verify official sources before use.
100,000+ technical questions answered, 98.7% rated helpful
Install
Three ways to ship Biel in Next.js
Wrap the chatbot in a client component, add a page-search field that hands queries to Ask AI, or expose your content via MCP for AI agents. Same SSR-safe pattern across all three.
Full installation guideSSR-safe wrapper component
The Biel widget is a web component, which the browser registers at runtime, so it has to render client-side only. Wrap it with
next/dynamic and ssr: false. Works on App Router and Pages Router alike.- →Floating Ask AI button on every page
- →App Router and Pages Router both supported
- →SSR-safe via next/dynamic with ssr: false
- →Add 'use client' for App Router boundary
components/biel-button.tsx
'use client'
// 1. npm install biel-react
import { useEffect } from 'react'
import { BielButton } from 'biel-react'
import { defineCustomElements } from 'biel-search/loader'
import 'biel-search/dist/biel-search/biel-search.css'
export default function ChatButton() {
useEffect(() => { defineCustomElements() }, [])
return (
<BielButton
project="<YOUR_PROJECT_ID>"
headerTitle="Documentation AI"
buttonPosition="bottom-right"
buttonStyle="dark"
>
Ask AI
</BielButton>
)
}
// 2. In app/layout.tsx, render it dynamically:
// import dynamic from 'next/dynamic'
// const ChatButton = dynamic(
// () => import('@/components/biel-button'),
// { ssr: false }
// )Things teams ask during evaluation
App Router or Pages Router?
Both work. The widget needs to be a client component, which on App Router means a
'use client' directive at the top of the wrapper. On Pages Router, plain client-side components work as usual.Will it break SSR?
No, but you have to import it dynamically with
ssr: false. The widget is a web component that the browser registers at runtime. Rendering it on the server would throw. The wrapper pattern handles this cleanly.Does it work with React Server Components?
Yes. The wrapper is a Client Component, and you import that into your Server Components like any other client boundary. RSC streams the rest of the page. The widget hydrates on the client.
Will it work on Vercel and other Next.js hosts?
Yes. The widget loads from a CDN at runtime. Nothing about the deploy target affects it. Vercel, Netlify, AWS Amplify, and custom Node servers are all supported.
Can we customize colors and styling?
Yes. Pass props for color, position, and style, or use CSS custom properties (
--biel-primary-color and friends) to override at the theme level. Tailwind, CSS Modules, and styled-components all work.How long does the install take?
Install the package, add a wrapper component, and load it with a dynamic import. Indexing time depends on the size of the site.
Make your Next.js app answer questions
14-day free trial · No credit card required