Skip to content
Documentation
Documentation

Event Types

These are the event objects passed to adapter methods. All types are importable from @datachef/mus/server.

import type { VoiceEvent, SupportEvent, StandaloneEvent } from '@datachef/mus/server'

Passed to onVoiceUpload when a user submits a voice recording.

interface VoiceEvent {
mp3Buffer: Buffer // Converted MP3 ready to upload
filename: string // e.g. "voice-feedback-hero-1234567890.mp3"
channelId: string // Slack channel ID from config
sectionName: string // Human-readable section label
sectionId: string // Machine-readable section identifier
name: string // User display name (defaults to "Anonymous")
email: string // User email (empty string if unauthenticated)
projectName: string
note: string // Optional note submitted with the recording
comment: string // Pre-formatted message string for display
}

Passed to onSupportRequest when a user submits the support dialog.

interface SupportEvent {
name: string
email: string
projectName: string
projectSlug: string
topic: string // User's message / explanation
sectionId: string
sectionName: string
supportTeamEmails: string[] // From SlackConfig: team members to invite
feedbackChannelId?: string // Fallback channel for anonymous requests
channelNamePrefix: string // Default: "support"
isAuthenticated: boolean // true if email is non-empty
}

onSupportRequest should return { channelId?: string }. The channel ID is sent back to the client to open the support link.

Passed to onStandaloneFeedback in standalone mode (screenshot + optional voice).

interface StandaloneEvent {
screenshotBuffer?: Buffer // PNG/JPEG screenshot, if captured
screenshotFilename?: string
mp3Buffer?: Buffer // Converted MP3, if voice was recorded
audioFilename?: string
channelId: string
name: string
email: string
projectName: string
note: string
sectionId: string
sectionName: string
metaComment: string // Pre-formatted meta string for display
}
EventAdapter method
VoiceEventonVoiceUpload
SupportEventonSupportRequest
StandaloneEventonStandaloneFeedback

Thumbs up/down feedback is sent directly to your Slack proxy URL and does not go through the adapter system.