What is Next.js

Next.js is a React framework that provides tools for building web applications with server-side rendering and static generation.

Install the component library

  • npm

  • bun

  • pnpm

  • yarn

npm install @inkeep/widgets

Customize your settings

Create a useInkeepSettings.ts file that will contain a hook that will return the configuration for Inkeep component(s).

const useInkeepSettings = () => {
  const baseSettings = {
    apiKey: process.env.INKEEP_INTEGRATION_API_KEY!,
    integrationId: process.env.INKEEP_INTEGRATION_ID!,
    organizationId: process.env.INKEEP_ORGANIZATION_ID!,
    primaryBrandColor: "#26D6FF", // your brand color, widget color scheme is derived from this
    organizationDisplayName: "Inkeep",
    // ...optional settings

  const modalSettings = {
    // optional settings

  const searchSettings = {
    // optional settings

  const aiChatSettings = {
    // optional settings
    botAvatarSrcUrl: "/img/logo.svg", // use your own bot avatar
    quickQuestions: [
      "Example question 1?",
      "Example question 2?",
      "Example question 3?",

  return { baseSettings, aiChatSettings, searchSettings, modalSettings };

export default useInkeepSettings;

Make sure to add your Inkeep identifiers to your environment settings. An example next.config.js file is below.

/** @type {import('next').NextConfig} */
const nextConfig = {
  env: {

module.exports = nextConfig;

You can alternatively use the NEXT_PUBLIC_ prefix in your environment variables to access them without a next.config.js file.

Define the component

Next, create an InkeepSearchBar component file for our Search Bar component.

For Next.js apps that use the App router, use the use client directive at the top of the file to load the widget on the client side.

import dynamic from 'next/dynamic';
import useInkeepSettings from '../utils/useInkeepSettings';

const SearchBar = dynamic(
  () => import('@inkeep/widgets').then((mod) => mod.InkeepSearchBar),
    ssr: false,

function InkeepSearchBar() {
  const {
    baseSettings, aiChatSettings, searchSettings, modalSettings,
  } = useInkeepSettings();

  const searchBarProps = {
    stylesheetUrls: ['/path/to/stylesheets'], // optional

  return <SearchBar {...searchBarProps} />;

export default InkeepSearchBar;

For a full list of customizations, check out the Search Bar documentation.