Skip to content

Commit 65d2e06

Browse files
committed
feat: Cookbook Onboard integration
fix
1 parent f7a7863 commit 65d2e06

File tree

5 files changed

+1774
-36
lines changed

5 files changed

+1774
-36
lines changed

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"analyze": "ANALYZE=true next build"
1818
},
1919
"dependencies": {
20+
"@cookbookdev/docsbot": "^4.21.5",
2021
"@emotion/cache": "11.11.0",
2122
"@emotion/react": "11.11.3",
2223
"@emotion/serialize": "1.1.3",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import dynamic from "next/dynamic";
2+
const BaseAskCookbook = dynamic(() => import("@cookbookdev/docsbot/react-fixed"), { ssr: false });
3+
4+
/** It's going to be exposed in HTTP requests anyway so it's fine to just hardcode it here */
5+
const COOKBOOK_PUBLIC_API_KEY =
6+
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI2NWNhYjFkMjU4OGEwOTU1ZDNjYWU2ZmYiLCJpYXQiOjE3MDc3ODI2MTAsImV4cCI6MjAyMzM1ODYxMH0.CxSlf6zY94GhJ93UPvw3_btAcDODHOP0MjmMEZuqb1M";
7+
8+
export const AskCookbook = () => {
9+
return <BaseAskCookbook apiKey={COOKBOOK_PUBLIC_API_KEY} />;
10+
};

src/pages/_app.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import type { AppProps } from "next/app";
77
import Script from "next/script";
88

99
import { HeadProgressBar, Layout } from "~/components/shared";
10+
import { AskCookbook } from "~/components/shared/components/AskCookbook";
1011
import { environment } from "~/env.cjs";
1112
import { useAppAnalytics } from "~/hooks/useAppAnalytics";
1213
import { useAppDispatch, wrapper } from "~/lib/app.store";
@@ -55,6 +56,7 @@ const App = ({ Component, pageProps, ...rest }: AppProps & { emotionCache: Emoti
5556
</Script>
5657
</>
5758
)}
59+
<AskCookbook />
5860
</>
5961
);
6062
};

src/types/ask-cookbook.d.ts

+4
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+
}

0 commit comments

Comments
 (0)