---
title: "First Message | Micdrop"
description: "Configure the initial message that greets users when they start a voice conversation."
url: "https://micdrop.dev/docs/server/first-message"
---

*   [Getting Started](/docs/getting-started)
*   [Client (Browser)](/docs/client)
    
    *   [Installation](/docs/client/installation)
    *   [React Hooks](/docs/client/react-hooks)
    *   [Start/Stop Call](/docs/client/start-stop-call)
    *   [Pause/Resume Call](/docs/client/pause-resume-call)
    *   [Mute/Unmute Call](/docs/client/mute-unmute-call)
    *   [Call State](/docs/client/call-state)
    *   [Display Conversation Messages](/docs/client/display-conversation-messages)
    *   [Handling Tool Calls](/docs/client/handling-tool-calls)
    *   [Device Management](/docs/client/devices-management)
    *   [Voice Activity Detection (VAD)](/docs/client/vad)
    *   [Error Handling](/docs/client/error-handling)
    *   Utility Classes
        
        *   [Mic](/docs/client/utility-classes/mic)
        *   [MicdropClient](/docs/client/utility-classes/micdrop-client)
        *   [MicRecorder](/docs/client/utility-classes/mic-recorder)
        *   [Speaker](/docs/client/utility-classes/speaker)
        
    
*   [Server (Node.js)](/docs/server)
    
    *   [Installation](/docs/server/installation)
    *   [With Fastify](/docs/server/with-fastify)
    *   [With NestJS](/docs/server/with-nestjs)
    *   [Auth and Parameters](/docs/server/auth-and-parameters)
    *   [First Message](/docs/server/first-message)
    *   [Save Messages](/docs/server/save-messages)
    *   [Resume a Conversation](/docs/server/resume-conversation)
    *   [Recording Audio](/docs/server/recording-audio)
    *   [Error Handling](/docs/server/error-handling)
    *   [Tools](/docs/server/tools)
    *   [Extract Value from Answer](/docs/server/extract)
    *   [Auto End Call](/docs/server/auto-end-call)
    *   [Semantic Turn Detection](/docs/server/semantic-turn-detection)
    *   [Noise Filtering](/docs/server/noise-filtering)
    *   [Micdrop Protocol](/docs/server/protocol)
    
*   [AI Integrations](/docs/ai-integration)
    
    *   Provided Integrations
        
        *   [AI SDK](/docs/ai-integration/provided-integrations/ai-sdk)
        *   [Cartesia](/docs/ai-integration/provided-integrations/cartesia)
        *   [ElevenLabs](/docs/ai-integration/provided-integrations/elevenlabs)
        *   [Gladia](/docs/ai-integration/provided-integrations/gladia)
        *   [Gradium](/docs/ai-integration/provided-integrations/gradium)
        *   [Mistral](/docs/ai-integration/provided-integrations/mistral)
        *   [OpenAI](/docs/ai-integration/provided-integrations/openai)
        
    *   Custom Integrations
        
        *   [Agent (LLM)](/docs/ai-integration/custom-integrations/custom-agent)
        *   [Speech-to-Text (STT)](/docs/ai-integration/custom-integrations/custom-stt)
        *   [Text-to-Speech (TTS)](/docs/ai-integration/custom-integrations/custom-tts)
        
    *   Fallback Strategies
        
        *   [FallbackAgent](/docs/ai-integration/fallback-strategies/agent-fallback)
        *   [FallbackSTT](/docs/ai-integration/fallback-strategies/stt-fallback)
        *   [FallbackTTS](/docs/ai-integration/fallback-strategies/tts-fallback)
        
    *   [IA Vocale Souveraine 🇫🇷🇪🇺](/docs/ai-integration/sovereign-voice-ai)
    

[Micdrop](/) › [Documentation](/docs/getting-started)

# First Message

Configure the initial message that greets users when they start a voice conversation.

## Static First Message

Set a fixed greeting message with `firstMessage` option:

```
new MicdropServer(socket, {  firstMessage: 'Hello! How can I help you today?',  agent,  stt,  tts,})
```

## Dynamic First Message Generation

Use `generateFirstMessage: true` to let the AI agent create personalized greetings with `systemPrompt`:

```
new MicdropServer(socket, {  generateFirstMessage: true, // Agent will generate the first message  agent: new OpenaiAgent({    apiKey: process.env.OPENAI_API_KEY,    systemPrompt:      'You are a helpful assistant. Start with a warm, personalized greeting.',  }),  stt,  tts,})
```

## Let the user speak first

Don’t set a first message to let the user speak first:

```
new MicdropServer(socket, {  agent,  stt,  tts,})
```

## Wake word

If you want the assistant to speak only after the user has spoken specific word(s), you can use the `onBeforeAnswer` hook in your agent configuration.

```
const WAKE_WORD = /Hello|Bonjour/const FIRST_MESSAGE = 'Hello! How can I help you today?'
new OpenaiAgent({  apiKey: process.env.OPENAI_API_KEY,  systemPrompt: 'You are a helpful assistant.',  onBeforeAnswer(stream) {    // Process only first message    const isFirstAnswer = !this.conversation.some(      (message) => message.role === 'assistant'    )    if (!isFirstAnswer) return
    // Get last user message    const lastUserMessage = this.conversation.findLast(      (message) => message.role === 'user'    ) as MicdropConversationMessage    if (!lastUserMessage) return
    // Check for wake word(s)    if (!WAKE_WORD.test(lastUserMessage.content)) {      // Remove message without answering      this.cancelLastUserMessage()      // Skip normal answer generation      return true    }
    // Send first assistant message    this.addAssistantMessage(FIRST_MESSAGE)    stream.write(FIRST_MESSAGE)    // Skip normal answer generation    return true  },})
```

[Previous← Auth and Parameters](/docs/server/auth-and-parameters)[NextSave Messages →](/docs/server/save-messages)

On this page

*   [Static First Message](#static-first-message)
*   [Dynamic First Message Generation](#dynamic-first-message-generation)
*   [Let the user speak first](#let-the-user-speak-first)
*   [Wake word](#wake-word)
