Ask AI assistant widget for Nextra
Add a Biel.ai AI assistant or AI search widget to your Nextra documentation using the biel-react package.
info
This guide covers Nextra v2 (Pages Router). If your project uses Nextra v3 (App Router with app/layout.tsx), see the Next.js installation guide instead.
Prerequisites
- A Biel.ai account.
- A project with indexed content.
- A Nextra v2 site.
- Node.js installed.
Add the assistant widget
The BielButton React component adds a floating chat button to your site.

-
Install the package:
npm install biel-react -
Create or update
pages/_app.tsx:import type { AppProps } from 'next/app';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 App({ Component, pageProps }: AppProps) {useEffect(() => {if (typeof window !== 'undefined') {defineCustomElements(window);}}, []);return (<><Component {...pageProps} /><BielButtonproject="<YOUR_PROJECT_ID>"header-title="Biel.ai assistant"button-position="bottom-right"modal-position="bottom-right"button-style="dark">Ask AI</BielButton></>);}Replace
<YOUR_PROJECT_ID>with your project's ID from the Biel.ai dashboard. -
Run
npm run devand verify the assistant appears on your site.
Next steps
- Customize the widget's appearance, behavior, and tone.
- Connect integrations like GitHub Actions, MCP, or Zapier.