Skip to content

Commit e4d56b3

Browse files
authored
📦 NEW: Intercom in BaseAI (#118)
1 parent cea5027 commit e4d56b3

File tree

4 files changed

+48
-5
lines changed

4 files changed

+48
-5
lines changed

‎apps/baseai.dev/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"@headlessui/react": "^1.7.15",
1717
"@headlessui/tailwindcss": "^0.2.0",
1818
"@heroicons/react": "^2.1.3",
19+
"@intercom/messenger-js-sdk": "^0.0.14",
1920
"@mdx-js/loader": "^3.0.0",
2021
"@mdx-js/react": "^3.0.0",
2122
"@next/mdx": "^14.0.4",
@@ -41,6 +42,7 @@
4142
"flexsearch": "^0.7.31",
4243
"framer-motion": "^10.18.0",
4344
"gray-matter": "^4.0.3",
45+
"html2canvas": "^1.4.1",
4446
"lucide-react": "^0.378.0",
4547
"mdast-util-to-string": "^4.0.0",
4648
"mdx-annotations": "^0.1.1",
@@ -61,7 +63,6 @@
6163
"tailwindcss": "^3.4.1",
6264
"tailwindcss-animate": "^1.0.7",
6365
"three": "^0.168.0",
64-
"html2canvas": "^1.4.1",
6566
"typescript": "^5.3.3",
6667
"unist-util-filter": "^5.0.1",
6768
"unist-util-visit": "^5.0.0",

‎apps/baseai.dev/src/app/layout.tsx

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Providers } from '@/app/providers';
2+
import IntercomClient from '@/components/intercom';
23
import '@/styles/tailwind.css';
34
import { Inter } from 'next/font/google';
45
const inter = Inter({ subsets: ['latin'] });
@@ -13,23 +14,27 @@ export async function generateMetadata() {
1314
openGraph: {
1415
title: 'BaseAI - The first Web AI Framework',
1516
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).`,
16-
images: ['https://raw.githubusercontent.com/LangbaseInc/docs-images/refs/heads/main/baseai/baseai-ogg.jpg'],
17+
images: [
18+
'https://raw.githubusercontent.com/LangbaseInc/docs-images/refs/heads/main/baseai/baseai-ogg.jpg'
19+
],
1720
siteName: 'BaseAI'
1821
},
1922
twitter: {
2023
card: 'summary_large_image',
2124
title: 'BaseAI - The first Web AI Framework',
2225
creator: '@LangbaseInc',
2326
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).`,
24-
images: ['https://raw.githubusercontent.com/LangbaseInc/docs-images/refs/heads/main/baseai/baseai-ogg.jpg']
27+
images: [
28+
'https://raw.githubusercontent.com/LangbaseInc/docs-images/refs/heads/main/baseai/baseai-ogg.jpg'
29+
]
2530
},
2631
authors: [{ name: 'Langbase, Inc.' }],
2732
robots: {
2833
index: true,
2934
follow: true,
3035
googleBot: {
3136
index: true,
32-
follow: true,
37+
follow: true
3338
}
3439
},
3540
keywords: 'BaseAI, Web AI framework',
@@ -47,7 +52,10 @@ export default async function RootLayout({
4752
return (
4853
<html lang="en" className="h-full" suppressHydrationWarning>
4954
<body className={`${inter.className}`}>
50-
<Providers>{children}</Providers>
55+
<Providers>
56+
<IntercomClient />
57+
{children}
58+
</Providers>
5159
</body>
5260
</html>
5361
);
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
'use client';
2+
3+
import Intercom from '@intercom/messenger-js-sdk';
4+
import { useEffect } from 'react';
5+
6+
const IntercomClient = () => {
7+
useEffect(() => {
8+
// Initialize Intercom.
9+
initializeIntercom();
10+
}, []);
11+
12+
const initializeIntercom = () => {
13+
// Check if app id exists.
14+
if (!process.env.NEXT_PUBLIC_INTERCOM_APP_ID) {
15+
return;
16+
}
17+
18+
Intercom({
19+
app_id: process.env.NEXT_PUBLIC_INTERCOM_APP_ID
20+
});
21+
};
22+
23+
return <></>;
24+
};
25+
26+
export default IntercomClient;

‎pnpm-lock.yaml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)