Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

Add /support (#150)

Marc Klingenbc1e3647b330
diff --git a/src/components/Support.tsx b/src/components/Support.tsx
new file mode 100644
index 0000000000..a95cac2a70
--- /dev/null
+++ b/src/components/Support.tsx
@@ -0,0 +1,116 @@
+import { Button } from "@/src/components/ui/button";
+import {
+ Card,
+ CardContent,
+ CardDescription,
+ CardFooter,
+ CardHeader,
+ CardTitle,
+} from "@/src/components/ui/card";
+import { chatAvailable, openChat } from "@/src/features/support-chat/chat";
+import {
+ Book,
+ Calendar,
+ Github,
+ Mail,
+ MessageSquare,
+ Slack,
+} from "lucide-react";
+import Link from "next/link";
+import { SiDiscord } from "react-icons/si";
+
+const supportChannels = [
+ {
+ icon: Book,
+ title: "Documentation",
+ description: "Find answers in the documentation.",
+ href: "https://docs.langfuse.com",
+ buttonText: "Visit Docs",
+ primary: true,
+ },
+ {
+ icon: Github,
+ title: "GitHub",
+ description:
+ "Create an issue on Github to report bugs or request new features.",
+ href: "https://github.com/langfuse/langfuse/issues/new/choose",
+ buttonText: "Create issue",
+ primary: true,
+ },
+ {
+ icon: SiDiscord,
+ title: "Discord",
+ description:
+ "Get support from community and maintainers. Follow announcements to stay up to date with new features.",
+ href: "https://langfuse.com/discord",
+ buttonText: "Join Discord",
+ primary: true,
+ },
+ {
+ icon: Mail,
+ title: "Email",
+ description: "Send email to our shared inbox: [email protected]",
+ href: "mailto:[email protected]",
+ buttonText: "Send Email",
+ available: !chatAvailable,
+ },
+ {
+ icon: MessageSquare,
+ title: "Chat",
+ description: "Get quick support directly from the team.",
+ onClick: () => openChat(),
+ available: chatAvailable,
+ buttonText: "Launch Chat",
+ },
+ {
+ icon: Calendar,
+ title: "Schedule call",
+ description: "Schedule a call with one of the founders.",
+ href: "https://cal.com/marc-kl/langfuse-cloud",
+ buttonText: "Schedule Call",
+ },
+ {
+ icon: Slack,
+ title: "Slack Connect",
+ description: "Get a dedicated support channel for you and your team.",
+ href: "mailto:[email protected]?subject=Slack%20Connect%20Request&body=I'd%20like%20to%20request%20a%20dedicated%20Slack%20Connect%20channel%20for%20me%20and%20my%20team.%0D%0A%0D%0AUsers%20(emails)%20to%20include%20besides%20mine%3A%0D%0A%0D%0A",
+ buttonText: "Request Slack Connect (via Email)",
+ },
+];
+
+export const SupportChannels = () => (
+ <div className="mt-10 grid grid-cols-1 gap-5 md:grid-cols-2 lg:grid-cols-3">
+ {supportChannels
+ .filter((channel) => channel.available === undefined || channel.available)
+ .map((channel) => (
+ <Card key={channel.title} className="flex flex-col">
+ <CardHeader>
+ <CardTitle className="flex items-center gap-2">
+ <channel.icon size={20} />
+ {channel.title}
+ </CardTitle>
+ </CardHeader>
+ <CardContent className="flex-1">
+ <CardDescription>{channel.description}</CardDescription>
+ </CardContent>
+ <CardFooter>
+ {channel.href ? (
+ <Button
+ asChild
+ variant={channel.primary ? "default" : "secondary"}
+ >
+ <Link href={channel.href}>{channel.buttonText}</Link>
+ </Button>
+ ) : (
+ <Button
+ onClick={channel.onClick}
+ variant={channel.primary ? "default" : "secondary"}
+ >
+ {channel.buttonText}
+ </Button>
+ )}
+ </CardFooter>
+ </Card>
+ ))}
+ </div>
+);
diff --git a/src/components/layouts/layout.tsx b/src/components/layouts/layout.tsx
index 1baa2eb329..39d8de75f8 100644
--- a/src/components/layouts/layout.tsx
+++ b/src/components/layouts/layout.tsx
@@ -212,7 +212,7 @@ export default function Layout(props: PropsWithChildren) {
</li>
))}
<FeedbackButtonWrapper className="w-full">
- <li className="group flex gap-x-3 rounded-md p-2 text-sm font-semibold leading-6 text-gray-700 hover:bg-gray-50 hover:text-indigo-600">
+ <li className="group flex cursor-pointer gap-x-3 rounded-md p-2 text-sm font-semibold leading-6 text-gray-700 hover:bg-gray-50 hover:text-indigo-600">
<MessageSquarePlus
className="h-6 w-6 shrink-0 text-gray-400 group-hover:text-indigo-600"
aria-hidden="true"
@@ -314,7 +314,7 @@ export default function Layout(props: PropsWithChildren) {
</li>
))}
<FeedbackButtonWrapper className="w-full">
- <li className="group flex gap-x-3 rounded-md p-2 text-sm font-semibold leading-6 text-gray-700 hover:bg-gray-50 hover:text-indigo-600">
+ <li className="group flex cursor-pointer gap-x-3 rounded-md p-2 text-sm font-semibold leading-6 text-gray-700 hover:bg-gray-50 hover:text-indigo-600">
<MessageSquarePlus
className="h-6 w-6 shrink-0 text-gray-400 group-hover:text-indigo-600"
aria-hidden="true"
@@ -416,7 +416,7 @@ export default function Layout(props: PropsWithChildren) {
onClick={() => void item.onClick()}
className={cn(
active ? "bg-gray-50" : "",
- "block px-3 py-1 text-sm leading-6 text-gray-900",
+ "block cursor-pointer px-3 py-1 text-sm leading-6 text-gray-900",
)}
>
{item.name}
@@ -476,7 +476,7 @@ export default function Layout(props: PropsWithChildren) {
onClick={() => void item.onClick()}
className={cn(
active ? "bg-gray-50" : "",
- "block px-3 py-1 text-sm leading-6 text-gray-900",
+ "block cursor-pointer px-3 py-1 text-sm leading-6 text-gray-900",
)}
>
{item.name}
diff --git a/src/components/layouts/routes.ts b/src/components/layouts/routes.ts
index e271663999..021dac4dc8 100644
--- a/src/components/layouts/routes.ts
+++ b/src/components/layouts/routes.ts
@@ -1,7 +1,7 @@
import {
FlaskConical,
- HelpingHand,
LayoutDashboard,
+ LifeBuoy,
LineChart,
ListTree,
Settings,
@@ -46,8 +46,8 @@ export const ROUTES = [
icon: Settings,
},
{
- name: "Talk to founder",
- pathname: "https://cal.com/marc-kl/langfuse-cloud",
- icon: HelpingHand,
+ name: "Support",
+ pathname: "/project/[projectId]/support",
+ icon: LifeBuoy,
},
];
diff --git a/src/features/support-chat/chat.tsx b/src/features/support-chat/chat.tsx
index 52604aa69a..1dcffeb09c 100644
--- a/src/features/support-chat/chat.tsx
+++ b/src/features/support-chat/chat.tsx
@@ -23,7 +23,7 @@ export const chatSetUser = ({
email: string;
data: object;
}) => {
- if (process.env.NEXT_PUBLIC_CRISP_WEBSITE_ID) {
+ if (chatAvailable) {
Crisp.user.setEmail(email);
Crisp.user.setNickname(name);
Crisp.session.setData(data);
@@ -33,13 +33,11 @@ export const chatSetUser = ({
type Trigger = "after-project-creation";
export const chatRunTrigger = (trigger: Trigger) => {
- if (process.env.NEXT_PUBLIC_CRISP_WEBSITE_ID) {
- Crisp.trigger.run(trigger);
- }
+ if (chatAvailable) Crisp.trigger.run(trigger);
};
export const openChat = () => {
- if (process.env.NEXT_PUBLIC_CRISP_WEBSITE_ID) {
- Crisp.chat.open();
- }
+ if (chatAvailable) Crisp.chat.open();
};
+
+export const chatAvailable = !!process.env.NEXT_PUBLIC_CRISP_WEBSITE_ID;
diff --git a/src/pages/index.tsx b/src/pages/index.tsx
index 7bfc8df0dc..513575efa2 100644
--- a/src/pages/index.tsx
+++ b/src/pages/index.tsx
@@ -13,6 +13,7 @@ import { api } from "@/src/utils/api";
import { useRouter } from "next/router";
import { useState, useEffect } from "react";
import { env } from "@/src/env.mjs";
+import { cn } from "@/src/utils/tailwind";
export default function GetStartedPage() {
const projects = api.projects.all.useQuery();
@@ -55,7 +56,14 @@ export default function GetStartedPage() {
return (
<div className="md:container">
- <Header title="Get started" />
+ <Header
+ title="Get started"
+ actionButtons={
+ <Button asChild>
+ <Link href="https://docs.langfuse.com">Visit docs ↗</Link>
+ </Button>
+ }
+ />
<div className="grid grid-cols-1 gap-5 lg:grid-cols-2">
<Card className="flex-1">
<CardHeader>
@@ -84,20 +92,14 @@ export default function GetStartedPage() {
</CardContent>
<CardFooter className="flex flex-wrap gap-2">
<Button asChild>
- <Link href={"/project/" + demoProject.id}>Go to project</Link>
- </Button>
- <Button asChild variant="secondary">
- <Link
- href="https://langfuse.com/docs/qa-chatbot"
- target="_blank"
- >
- Chatbot
+ <Link href={"/project/" + demoProject.id}>
+ Go to demo project
</Link>
</Button>
</CardFooter>
</Card>
) : null}
- <Card className="col-span-full">
+ <Card className={cn(demoProject && "col-span-full")}>
<CardHeader>
<CardTitle>Guided onboarding</CardTitle>
</CardHeader>
diff --git a/src/pages/project/[projectId]/support.tsx b/src/pages/project/[projectId]/support.tsx
new file mode 100644
index 0000000000..a73c938088
--- /dev/null
+++ b/src/pages/project/[projectId]/support.tsx
@@ -0,0 +1,17 @@
+import { SupportChannels } from "@/src/components/Support";
+import Header from "@/src/components/layouts/header";
+
+export default function SupportPage() {
+ return (
+ <div className="md:container">
+ <Header title="Support" />
+ <div className="flex flex-col gap-10">
+ <p>
+ We are here to help in case of questions or issues. Pick the channel
+ that is most convenient for you!
+ </p>
+ </div>
+ <SupportChannels />
+ </div>
+ );
+}