---
title: "Interact with bots"
section: "frontend/interactions"
platforms: ["angular", "javascript", "nextjs", "react", "react-native", "vue"]
gen: 2
last-updated: "2026-03-25T17:40:00.000Z"
url: "https://docs.amplify.aws/react/frontend/interactions/chatbot/"
---

## Send messages to bot
You can send a text message to chatbot backend with `send()` command. The method returns a promise that includes the chatbot response.

```javascript title="src/App.tsx"
import { Interactions } from '@aws-amplify/interactions';

const userInput = "I want to reserve a hotel for tonight";

// Provide a bot name and user input
const response = await Interactions.send({
  botName: "TheBotName",
  message: userInput
});

// Log chatbot response
console.log(response.message);
```

## Display end of chat message

You can use `onComplete()` method to register a function to catch errors or chatbot confirmations when the session successfully ends.

```typescript title="src/App.tsx"
import { Interactions } from '@aws-amplify/interactions';

Interactions.onComplete({
  botName: "TheBotName",
  callback: (error?: Error, completion?: {[key: string]: any}) => {
     if (error) {
        alert('bot conversation failed');
     } else if (completion) {
        console.debug('done: ' + JSON.stringify(completion, null, 2));
        alert('Trip booked. Thank you! What would you like to do next?');
     }
  }
});
```
