🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.
TypeScript analyticsautogenevaluationlangchainlarge-language-modelsllama-indexllmllm-evaluationllm-observabilityllmopsmonitoringobservabilityopen-sourceopenaiplaygroundprompt-engineeringprompt-managementself-hostedycombinator
Add chat message trigger (#65)
Marc Klingen1456873e4081
diff --git a/src/features/projects/components/NewProjectButton.tsx b/src/features/projects/components/NewProjectButton.tsxindex 106e525f89..27b8567c01 100644--- a/src/features/projects/components/NewProjectButton.tsx+++ b/src/features/projects/components/NewProjectButton.tsx@@ -25,6 +25,7 @@ import { useRouter } from "next/router";import { cn } from "@/src/utils/tailwind";import { useState } from "react";import { useSession } from "next-auth/react";+import { chatRunTrigger } from "@/src/features/support-chat/chat";const formSchema = z.object({name: z.string().min(3, "Must have at least 3 characters"),@@ -64,6 +65,7 @@ export function NewProjectButton({ size = "default" }: NewProjectButtonProps) {.catch((error) => {console.error(error);});+ void chatRunTrigger("after-project-creation");}return (diff --git a/src/features/support-chat/chat.tsx b/src/features/support-chat/chat.tsxindex 23a3587fbd..4ba40ea6f0 100644--- a/src/features/support-chat/chat.tsx+++ b/src/features/support-chat/chat.tsx@@ -29,3 +29,11 @@ export const chatSetUser = ({Crisp.session.setData(data);}};++type Trigger = "after-project-creation";++export const chatRunTrigger = (trigger: Trigger) => {+ if (process.env.NEXT_PUBLIC_CRISP_WEBSITE_ID) {+ Crisp.trigger.run(trigger);+ }+};