diff --git a/apps/baseai.dev/package.json b/apps/baseai.dev/package.json index 3a6c7e23..43ce4ecc 100644 --- a/apps/baseai.dev/package.json +++ b/apps/baseai.dev/package.json @@ -16,6 +16,7 @@ "@headlessui/react": "^1.7.15", "@headlessui/tailwindcss": "^0.2.0", "@heroicons/react": "^2.1.3", + "@intercom/messenger-js-sdk": "^0.0.14", "@mdx-js/loader": "^3.0.0", "@mdx-js/react": "^3.0.0", "@next/mdx": "^14.0.4", @@ -41,6 +42,7 @@ "flexsearch": "^0.7.31", "framer-motion": "^10.18.0", "gray-matter": "^4.0.3", + "html2canvas": "^1.4.1", "lucide-react": "^0.378.0", "mdast-util-to-string": "^4.0.0", "mdx-annotations": "^0.1.1", @@ -61,7 +63,6 @@ "tailwindcss": "^3.4.1", "tailwindcss-animate": "^1.0.7", "three": "^0.168.0", - "html2canvas": "^1.4.1", "typescript": "^5.3.3", "unist-util-filter": "^5.0.1", "unist-util-visit": "^5.0.0", diff --git a/apps/baseai.dev/src/app/layout.tsx b/apps/baseai.dev/src/app/layout.tsx index d0166555..9db3326d 100644 --- a/apps/baseai.dev/src/app/layout.tsx +++ b/apps/baseai.dev/src/app/layout.tsx @@ -1,4 +1,5 @@ import { Providers } from '@/app/providers'; +import IntercomClient from '@/components/intercom'; import '@/styles/tailwind.css'; import { Inter } from 'next/font/google'; const inter = Inter({ subsets: ['latin'] }); @@ -13,7 +14,9 @@ export async function generateMetadata() { openGraph: { title: 'BaseAI - The first Web AI Framework', description: `BaseAI is the first web AI framework. Deployable with Langbase the composable serverless AI cloud. Built with a focus on simplicity and composability. Helping developers build AI agents with memory (RAG), and deploy serverless. It's composable by design and offers a simple API to build and deploy any AI agents (AI features).`, - images: ['https://raw.githubusercontent.com/LangbaseInc/docs-images/refs/heads/main/baseai/baseai-ogg.jpg'], + images: [ + 'https://raw.githubusercontent.com/LangbaseInc/docs-images/refs/heads/main/baseai/baseai-ogg.jpg' + ], siteName: 'BaseAI' }, twitter: { @@ -21,7 +24,9 @@ export async function generateMetadata() { title: 'BaseAI - The first Web AI Framework', creator: '@LangbaseInc', description: `BaseAI is the first web AI framework. Deployable with Langbase the composable serverless AI cloud. Built with a focus on simplicity and composability. Helping developers build AI agents with memory (RAG), and deploy serverless. It's composable by design and offers a simple API to build and deploy any AI agents (AI features).`, - images: ['https://raw.githubusercontent.com/LangbaseInc/docs-images/refs/heads/main/baseai/baseai-ogg.jpg'] + images: [ + 'https://raw.githubusercontent.com/LangbaseInc/docs-images/refs/heads/main/baseai/baseai-ogg.jpg' + ] }, authors: [{ name: 'Langbase, Inc.' }], robots: { @@ -29,7 +34,7 @@ export async function generateMetadata() { follow: true, googleBot: { index: true, - follow: true, + follow: true } }, keywords: 'BaseAI, Web AI framework', @@ -47,7 +52,10 @@ export default async function RootLayout({ return ( - {children} + + + {children} + ); diff --git a/apps/baseai.dev/src/components/intercom.tsx b/apps/baseai.dev/src/components/intercom.tsx new file mode 100644 index 00000000..8ec3ad06 --- /dev/null +++ b/apps/baseai.dev/src/components/intercom.tsx @@ -0,0 +1,26 @@ +'use client'; + +import Intercom from '@intercom/messenger-js-sdk'; +import { useEffect } from 'react'; + +const IntercomClient = () => { + useEffect(() => { + // Initialize Intercom. + initializeIntercom(); + }, []); + + const initializeIntercom = () => { + // Check if app id exists. + if (!process.env.NEXT_PUBLIC_INTERCOM_APP_ID) { + return; + } + + Intercom({ + app_id: process.env.NEXT_PUBLIC_INTERCOM_APP_ID + }); + }; + + return <>; +}; + +export default IntercomClient; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9286d013..01781b29 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -63,6 +63,9 @@ importers: '@heroicons/react': specifier: ^2.1.3 version: 2.1.5(react@18.3.1) + '@intercom/messenger-js-sdk': + specifier: ^0.0.14 + version: 0.0.14 '@mdx-js/loader': specifier: ^3.0.0 version: 3.0.1(webpack@5.95.0(esbuild@0.17.19)) @@ -2105,6 +2108,9 @@ packages: cpu: [x64] os: [win32] + '@intercom/messenger-js-sdk@0.0.14': + resolution: {integrity: sha512-2dH4BDAh9EI90K7hUkAdZ76W79LM45Sd1OBX7t6Vzy8twpNiQ5X+7sH9G5hlJlkSGnf+vFWlFcy9TOYAyEs1hA==} + '@isaacs/cliui@8.0.2': resolution: {integrity: sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==} engines: {node: '>=12'} @@ -10686,6 +10692,8 @@ snapshots: '@img/sharp-win32-x64@0.33.5': optional: true + '@intercom/messenger-js-sdk@0.0.14': {} + '@isaacs/cliui@8.0.2': dependencies: string-width: 5.1.2