diff --git a/packages/plugin-docusaurus-v3/src/index.ts b/packages/plugin-docusaurus-v3/src/index.ts index 7695dee48..a7de26fe0 100644 --- a/packages/plugin-docusaurus-v3/src/index.ts +++ b/packages/plugin-docusaurus-v3/src/index.ts @@ -59,7 +59,7 @@ export default function OramaPluginDocusaurus( }, async allContentLoaded({ actions, allContent }) { - const isDevelopment = process.env.NODE_ENV === 'development' || !options.cloud?.oramaCloudAPIKey + const isDevelopment = process.env.NODE_ENV === 'development' || (options.cloud && !options.cloud?.oramaCloudAPIKey) const docsInstances: string[] = [] const oramaCloudAPIKey = options.cloud?.oramaCloudAPIKey const searchDataConfig = [ diff --git a/packages/plugin-docusaurus-v3/src/theme/SearchBar/useOrama.ts b/packages/plugin-docusaurus-v3/src/theme/SearchBar/useOrama.ts index becdea263..9204e64ef 100644 --- a/packages/plugin-docusaurus-v3/src/theme/SearchBar/useOrama.ts +++ b/packages/plugin-docusaurus-v3/src/theme/SearchBar/useOrama.ts @@ -20,7 +20,7 @@ export const useOrama = () => { const isBrowser = useIsBrowser() useEffect(() => { async function loadOrama() { - if (endpoint) { + if (endpoint?.url) { setSearchBoxConfig({ oramaInstance: new OramaClient({ endpoint: endpoint.url,