Skip to content

Commit

Permalink
Read inkeep configurations from the secrets (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
taraspos authored Nov 1, 2024
1 parent 644c8f6 commit 9e542a4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
16 changes: 9 additions & 7 deletions docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,15 @@ import { extendedPostcssConfigPlugin } from "./server/postcss";
const latestVersion = getLatestVersion();

const config: Config = {
onBrokenMarkdownLinks: "throw",
customFields: {
innkeepConfig: {
apiKey: process.env.INKEEP_API_KEY,
integrationId: process.env.INKEEP_INTEGRATION_ID,
organizationId: process.env.INKEEP_ORGANIZATION_ID,
},
inkeepConfig: (() => {
const configVars = process.env.secrets ? JSON.parse(process.env.secrets) : process.env;
return {
apiKey: configVars.INKEEP_API_KEY,
integrationId: configVars.INKEEP_INTEGRATION_ID,
organizationId: configVars.INKEEP_ORGANIZATION_ID,
}
})(),
},
clientModules: [
"./src/styles/variables.css",
Expand Down Expand Up @@ -121,7 +123,7 @@ const config: Config = {
},

onBrokenLinks: "warn",
onBrokenMarkdownLinks: "warn",
onBrokenMarkdownLinks: "throw",

i18n: {
defaultLocale: "en",
Expand Down
8 changes: 4 additions & 4 deletions src/components/Search/InkeepSearch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,16 @@ export function InkeepSearch() {

const { siteConfig } = useDocusaurusContext();

const innkeepConfig = siteConfig.customFields.innkeepConfig as {
const inkeepConfig = siteConfig.customFields.inkeepConfig as {
apiKey: string;
integrationId: string;
organizationId: string;
};

const inkeepBaseSettings: InkeepWidgetBaseSettings = {
apiKey: innkeepConfig.apiKey,
integrationId: innkeepConfig.integrationId,
organizationId: innkeepConfig.organizationId,
apiKey: inkeepConfig.apiKey,
integrationId: inkeepConfig.integrationId,
organizationId: inkeepConfig.organizationId,
organizationDisplayName: "Teleport",
primaryBrandColor: "#512FC9",
chatApiProxyDomain: "goteleport.com/inkeep-proxy",
Expand Down

0 comments on commit 9e542a4

Please sign in to comment.