Skip to content

Commit a6685be

Browse files
authored
chore: Cookbook Onboard integration (#7044)
1 parent a311791 commit a6685be

File tree

3 files changed

+3098
-79
lines changed

3 files changed

+3098
-79
lines changed

docs/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"version": "yarn version::stables && ./scripts/cut_version.sh"
1414
},
1515
"dependencies": {
16+
"@cookbookdev/docsbot": "^4.24.9",
1617
"@docusaurus/core": "^3.5.2",
1718
"@docusaurus/preset-classic": "^3.5.2",
1819
"@easyops-cn/docusaurus-search-local": "^0.35.0",

docs/src/theme/SearchBar/index.js

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import React from 'react';
2+
import SearchBar from '@theme-original/SearchBar';
3+
import AskCookbook from '@cookbookdev/docsbot/react'
4+
import BrowserOnly from '@docusaurus/BrowserOnly';
5+
/** It's a public API key, so it's safe to expose it here */
6+
const COOKBOOK_PUBLIC_API_KEY = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI2NzVhMGVkODQ4MGI5OThmNzlhNjNhOTciLCJpYXQiOjE3MzM5NTUyODgsImV4cCI6MjA0OTUzMTI4OH0.NzQlH2sfhJkjvnYxoaRgSY6nRyNClxHg57n3-JueN9Q";
7+
export default function SearchBarWrapper(props) {
8+
return (
9+
<>
10+
<SearchBar {...props} />
11+
<BrowserOnly>{() => <AskCookbook apiKey={COOKBOOK_PUBLIC_API_KEY} /> }</BrowserOnly>
12+
</>
13+
);
14+
}

0 commit comments

Comments
 (0)