Comment Mention Handler (notifications/commentMentionHandler.ts)

langfuse · worker/src/features/notifications/commentMentionHandler.ts · typescript · MIT
database, chat, email

Handles notifications for mentions in comments and builds links to them.

// Source: https://github.com/langfuse/langfuse | License: MIT | Copyright 2023-2026 ClickHouse, Inc
// Provided via justclaw.it.com; keep this notice with the code.
import { env } from "../../env";
import {
  logger,
  sendCommentMentionEmail,
  getObservationById,
} from "@langfuse/shared/src/server";
import { prisma } from "@langfuse/shared/src/db";
import { Prisma } from "@langfuse/shared";
import { getUserProjectRoles } from "@langfuse/shared/src/server";
import { type NotificationEventType } from "@langfuse/shared/src/server";

type CommentMentionPayload = Omit<
  Extract<NotificationEventType, { type: "COMMENT_MENTION" }>,
  "type"
>;

async function buildCommentLink(opts: {
  baseUrl: string;
  projectId: string;
  comment: {
    objectType: "OBSERVATION" | "PROMPT" | "TRACE" | "SE

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key