Skip to content

Commit ef457ed

Browse files
committed
Refactor Docusaurus config to conditionally include Inkeep chatButton and searchBar plugins based on API key presence
1 parent a94051b commit ef457ed

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

docusaurus.config.ts

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -176,18 +176,21 @@ const config: Config = {
176176
} satisfies Preset.ThemeConfig,
177177
plugins: [
178178
require.resolve("./src/plugins/webpack-browserify"),
179-
"@inkeep/docusaurus/chatButton",
180-
"@inkeep/docusaurus/searchBar",
181-
...(process.env.POSTHOG_API_KEY ? [
182-
[
183-
"posthog-docusaurus",
184-
{
185-
apiKey: process.env.POSTHOG_API_KEY,
186-
appUrl: "https://us.i.posthog.com",
187-
enableInDevelopment: false,
188-
},
189-
],
190-
] : []),
179+
...(process.env.INKEEP_API_KEY
180+
? ["@inkeep/docusaurus/chatButton", "@inkeep/docusaurus/searchBar"]
181+
: []),
182+
...(process.env.POSTHOG_API_KEY
183+
? [
184+
[
185+
"posthog-docusaurus",
186+
{
187+
apiKey: process.env.POSTHOG_API_KEY,
188+
appUrl: "https://us.i.posthog.com",
189+
enableInDevelopment: false,
190+
},
191+
],
192+
]
193+
: []),
191194
],
192195
markdown: {
193196
mermaid: true,

0 commit comments

Comments
 (0)