Skip to content

Commit c8cc968

Browse files
committed
feat: Cookbook Onboard integration
1 parent b9436d0 commit c8cc968

File tree

5 files changed

+25302
-17583
lines changed

5 files changed

+25302
-17583
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" {
3+
export { default } from "@cookbookdev/docsbot/dist/react/index.d.ts";
4+
}

components/AskCookbook.tsx

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

0 commit comments

Comments
 (0)