/** * When running Langfuse in HuggingFace Spaces, the app needs to be opened in a new tab. * Otherwise, the app will not be able to access the session cookie. */ import { Button } from "@/src/components/ui/button"; import { LangfuseIcon } from "@/src/components/LangfuseLogo"; import Head from "next/head"; import Link from "next/link"; import { type GetServerSideProps } from "next"; import { env } from "@/src/env.mjs"; import { PlusIcon } from "lucide-react"; import { CodeView } from "@/src/components/ui/CodeJsonViewer"; type PageProps = { deploymentDomain: string; }; export const getServerSideProps: GetServerSideProps = async () => { // remove /api/auth from the URL as it needs to be added for custom base url const deploymentDomain = env.NEXTAUTH_URL?.replace("/api/auth", ""); return { props: { deploymentDomain, }, }; }; export default function HfSpaces({ deploymentDomain }: PageProps) { return ( <> Langfuse on Hugging Face
{/* eslint-disable-next-line @next/next/no-img-element */} Hugging Face Logo

Langfuse on Hugging Face

); }