Skip to content

Commit 99c2e52

Browse files
committed
feat: Cookbook Onboard integration
fix
1 parent b9436d0 commit 99c2e52

File tree

5 files changed

+25304
-17584
lines changed

5 files changed

+25304
-17584
lines changed

ask-cookbook.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// Solves the following error: "Cannot find module ... or its corresponding type declarations. There are types at ..., but this result could not be resolved under your current 'moduleResolution' setting. Consider updating to 'node16', 'nodenext', or 'bundler'. [2307]"
2+
declare module "@cookbookdev/docsbot/react-fixed" {
3+
export { default } from "@cookbookdev/docsbot/dist/react-fixed/index.d.ts";
4+
}

components/AskCookbook.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import dynamic from "next/dynamic";
2+
const BaseAskCookbook = dynamic(
3+
() => import("@cookbookdev/docsbot/react-fixed"),
4+
{ ssr: false },
5+
);
6+
7+
/** It's going to be exposed in HTTP requests anyway so it's fine to just hardcode it here */
8+
const COOKBOOK_PUBLIC_API_KEY =
9+
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI2NmE5YTdhZmNhMjA3NDg1NDU1YTIyMDYiLCJpYXQiOjE3MjIzOTQ1NDMsImV4cCI6MjAzNzk3MDU0M30.9gU7TfUlrFJcruL89tm4YPauUmxB6iRJ27mhaNW8fdc";
10+
11+
export const AskCookbook = () => {
12+
return <BaseAskCookbook apiKey={COOKBOOK_PUBLIC_API_KEY} />;
13+
};

0 commit comments

Comments
 (0)