Skip to content

Commit

Permalink
📦 NEW: Intercom in BaseAI (#118)
Browse files Browse the repository at this point in the history
  • Loading branch information
msaaddev authored Nov 12, 2024
1 parent cea5027 commit e4d56b3
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 5 deletions.
3 changes: 2 additions & 1 deletion apps/baseai.dev/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand Down
16 changes: 12 additions & 4 deletions apps/baseai.dev/src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -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'] });
Expand All @@ -13,23 +14,27 @@ 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: {
card: 'summary_large_image',
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: {
index: true,
follow: true,
googleBot: {
index: true,
follow: true,
follow: true
}
},
keywords: 'BaseAI, Web AI framework',
Expand All @@ -47,7 +52,10 @@ export default async function RootLayout({
return (
<html lang="en" className="h-full" suppressHydrationWarning>
<body className={`${inter.className}`}>
<Providers>{children}</Providers>
<Providers>
<IntercomClient />
{children}
</Providers>
</body>
</html>
);
Expand Down
26 changes: 26 additions & 0 deletions apps/baseai.dev/src/components/intercom.tsx
Original file line number Diff line number Diff line change
@@ -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;
8 changes: 8 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e4d56b3

Please sign in to comment.