Add Chat and Search to Docusaurus
Copy page
Integrate Inkeep's chat button and search bar into your Docusaurus documentation for enhanced user experience.
What is Docusaurus
Docusaurus is an open-source documentation platform powered by MDX and React.
Get an API key
Follow these steps to create an API key for your web integration.
Install the Inkeep plugin
If you are already using Algolia DocSearch
provided by Docusaurus by
default, it will be replaced by our widget.
Configuration settings
You have two configuration options:
- Configure the widget in the plugin
options
. Use this option if you are loading your apiKey from an environment variable, see here for more information. - Configure the widget in standalone
config
. Use this option if you are using any callback functions (liketransformSource
,onEvent
, orgetTools
) in your config.
These options can also be used together and the settings will be merged automatically.
Configure the widget in the plugin options
Docusaurus plugins can accept a tuple of [pluginName, options]
.
In this case, the plugin name is @inkeep/cxkit-docusaurus
.
Note that if you are using any callback functions (like transformSource
, onEvent
, or getTools
) in your config, you will need to use the standalone config to pass those settings.
So use like this:
You will need to replace REPLACE_WITH_YOUR_INKEEP_API_KEY
with your actual
Inkeep API key in the code below.
Configure the widget in standalone config
In this case, the plugin name is @inkeep/cxkit-docusaurus
.
What this means is that you create a config file in your project. By default, you can create an inkeep.config.js
or inkeep.config.ts
file in the root of your project, and Inkeep will automatically pick it up.
You can customize the path to the config file in the plugin options:
We also export a fully typed defineConfig
function that you can use to create your config:
For a full list of customizations, check out the Common Settings.
If you have already created a custom SearchBar
component (for example via
swizzle eject
) this will need to be removed in order to use our Search Bar.