Skip to content

Docusaurus Plugin

The docusaurus plugin allows you to index the content of your Docusaurus websites and offer text search to your visitors. This plugin can be used in OSS mode where you host the documents, or in cloud mode where your data will be stored by us and you will have access to analytics where you can see the number of queries and much more.

Pre-requisites

In order guarantee a correct functionality of the plugin, you need to have the @docusaurus/core at least in the version 3.2.0.

WARNING

This plugin do not support Docusaurus v2. Use @orama/plugin-docusaurus instead.

Installation

You can install the plugin using any major Node.js package manager:

bash
npm install @orama/plugin-docusaurus-v3
bash
pnpm install @orama/plugin-docusaurus-v3
bash
yarn add @orama/plugin-docusaurus-v3

Usage

With Orama OSS

Add the plugin to your docusaurus.config.js:

js
{
  // ...
  plugins: ["@orama/plugin-docusaurus-v3"],
  // ...
}

And that's it, you now have a search that will update whenever you build your site.

With Orama Cloud

If you want to use Orama Cloud as the source so you can have access to analytics for free you need a couple more variables:

js
// ...
plugins: [
  [
    "@orama/plugin-docusaurus-v3",
    {
      cloud: {
        indexId: "<your_orama_index_id>",
        oramaCloudAPIKey: process.env.ORAMA_CLOUD_API_KEY, // Env variable suggested
        deploy: true, // Enables deploy while building/starting
      },
    },
  ],
];
// ...

To get this variables first create a new integration for HTTP Integrations in here:

select integrations

And then docusaurus:

select Docusaurus

On the next page you will see all the variables you need to get you up and running:

the variables

And you are set, if you set deploy to true your index will update whenever you build the website and there are changes to your pages.