Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Cookbook Onboard (AI Assistant) integration #407

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"analyze": "ANALYZE=true next build"
},
"dependencies": {
"@cookbookdev/docsbot": "^4.21.5",
"@emotion/cache": "11.11.0",
"@emotion/react": "11.11.3",
"@emotion/serialize": "1.1.3",
Expand Down
10 changes: 10 additions & 0 deletions src/components/shared/components/AskCookbook.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import dynamic from "next/dynamic";
const BaseAskCookbook = dynamic(() => import("@cookbookdev/docsbot/react-fixed"), { ssr: false });

/** It's going to be exposed in HTTP requests anyway so it's fine to just hardcode it here */
const COOKBOOK_PUBLIC_API_KEY =
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI2NWNhYjFkMjU4OGEwOTU1ZDNjYWU2ZmYiLCJpYXQiOjE3MDc3ODI2MTAsImV4cCI6MjAyMzM1ODYxMH0.CxSlf6zY94GhJ93UPvw3_btAcDODHOP0MjmMEZuqb1M";
ClockRide marked this conversation as resolved.
Show resolved Hide resolved

export const AskCookbook = () => {
return <BaseAskCookbook apiKey={COOKBOOK_PUBLIC_API_KEY} />;
};
2 changes: 2 additions & 0 deletions src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import type { AppProps } from "next/app";
import Script from "next/script";

import { HeadProgressBar, Layout } from "~/components/shared";
import { AskCookbook } from "~/components/shared/components/AskCookbook";
import { environment } from "~/env.cjs";
import { useAppAnalytics } from "~/hooks/useAppAnalytics";
import { useAppDispatch, wrapper } from "~/lib/app.store";
Expand Down Expand Up @@ -55,6 +56,7 @@ const App = ({ Component, pageProps, ...rest }: AppProps & { emotionCache: Emoti
</Script>
</>
)}
<AskCookbook />
</>
);
};
Expand Down
4 changes: 4 additions & 0 deletions src/types/ask-cookbook.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// 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]"
declare module "@cookbookdev/docsbot/react-fixed" {
export { default } from "@cookbookdev/docsbot/dist/react-fixed/index.d.ts";
}
Loading
Loading