diff --git a/app/layout.tsx b/app/layout.tsx index b234051f943..be2162475d8 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -4,6 +4,10 @@ import "./styles/markdown.scss"; import "./styles/highlight.scss"; import { getClientConfig } from "./config/client"; import { type Metadata } from "next"; +import { SpeedInsights } from "@vercel/speed-insights/next"; +import { getServerSideConfig } from "./config/server"; + +const serverConfig = getServerSideConfig(); export const metadata: Metadata = { title: "NextChat", @@ -35,7 +39,14 @@ export default function RootLayout({ - {children} + + {children} + {serverConfig?.isVercel && ( + <> + + + )} + ); } diff --git a/app/page.tsx b/app/page.tsx index 20b503174d4..b3f169a9b74 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -10,7 +10,11 @@ export default async function App() { return ( <> - {serverConfig?.isVercel && } + {serverConfig?.isVercel && ( + <> + + + )} ); } diff --git a/package.json b/package.json index 102461b314f..a014c7bfe14 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "@hello-pangea/dnd": "^16.5.0", "@svgr/webpack": "^6.5.1", "@vercel/analytics": "^0.1.11", + "@vercel/speed-insights": "^1.0.2", "emoji-picker-react": "^4.5.15", "fuse.js": "^7.0.0", "html-to-image": "^1.11.11", diff --git a/yarn.lock b/yarn.lock index 5469672db2b..bf07c27eea1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1704,6 +1704,11 @@ resolved "https://registry.yarnpkg.com/@vercel/analytics/-/analytics-0.1.11.tgz#727a0ac655a4a89104cdea3e6925476470299428" integrity sha512-mj5CPR02y0BRs1tN3oZcBNAX9a8NxsIUl9vElDPcqxnMfP0RbRc9fI9Ud7+QDg/1Izvt5uMumsr+6YsmVHcyuw== +"@vercel/speed-insights@^1.0.2": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@vercel/speed-insights/-/speed-insights-1.0.2.tgz#1bebf3e7c7046b6a911721233b263b69214ddb3e" + integrity sha512-y5HWeB6RmlyVYxJAMrjiDEz8qAIy2cit0fhBq+MD78WaUwQvuBnQlX4+5MuwVTWi46bV3klaRMq83u9zUy1KOg== + "@webassemblyjs/ast@1.11.6", "@webassemblyjs/ast@^1.11.5": version "1.11.6" resolved "https://registry.npmmirror.com/@webassemblyjs/ast/-/ast-1.11.6.tgz#db046555d3c413f8966ca50a95176a0e2c642e24"