
Research
/Security News
Intercom’s npm Package Compromised in Ongoing Mini Shai-Hulud Worm Attack
Compromised intercom-client@7.0.4 npm package is tied to the ongoing Mini Shai-Hulud worm attack targeting developer and CI/CD secrets.
@sendbird/ai-agent-messenger-react
Advanced tools
The Delight AI agent Messenger React allows seamless integration of chatbot features into your React application.
This guide explains:
Before you start, you'll need your Application ID and AI agent ID.
You can find it under the Channels > Messenger menu on the Delight AI dashboard.

System requirements:
Quickly install and initialize the AI agent SDK by following the steps below.
Install the package with its peer dependencies using npm or yarn:
npm install @sendbird/ai-agent-messenger-react @sendbird/chat styled-components
# or
yarn add @sendbird/ai-agent-messenger-react @sendbird/chat styled-components
Note: Modern npm versions automatically install peer dependencies, but explicitly installing them ensures compatibility and avoids potential version conflicts.
The React SDK provides two main approaches for integration:
Option 1: FixedMessenger (recommended for quick setup)
FixedMessenger provides a predefined UI toolkit with launcher and messenger at fixed position (bottom-right):
import { FixedMessenger } from '@sendbird/ai-agent-messenger-react';
import '@sendbird/ai-agent-messenger-react/index.css';
function App() {
return <FixedMessenger appId="YOUR_APP_ID" aiAgentId="YOUR_AI_AGENT_ID" />;
}
Option 2: AgentProviderContainer (for custom UI implementations)
AgentProviderContainer allows for custom UI implementations and component-level integration:
import { AgentProviderContainer, Conversation } from '@sendbird/ai-agent-messenger-react';
import '@sendbird/ai-agent-messenger-react/index.css';
function App() {
return (
<AgentProviderContainer appId="YOUR_APP_ID" aiAgentId="YOUR_AI_AGENT_ID">
<Conversation />
</AgentProviderContainer>
);
}
Custom host configuration
If needed, you can specify custom API and WebSocket hosts:
<FixedMessenger
appId="YOUR_APP_ID"
aiAgentId="YOUR_AI_AGENT_ID"
customApiHost="https://your-proxy-api.example.com"
customWebSocketHost="wss://your-proxy-websocket.example.com"
/>
Similarly, when using AgentProviderContainer:
<AgentProviderContainer
appId="YOUR_APP_ID"
aiAgentId="YOUR_AI_AGENT_ID"
customApiHost="https://your-proxy-api.example.com"
customWebSocketHost="wss://your-proxy-websocket.example.com"
>
<Conversation />
</AgentProviderContainer>
Both properties are optional and only need to be configured if required.
FixedMessenger:
AgentProviderContainer:
<Conversation />Now that you have installed and initialized the AI agent SDK, follow the steps below to run your application.
To launch and display the messenger, implement the code below:
Note: Replace
YOUR_APP_IDandYOUR_AI_AGENT_IDwith your Application ID and AI agent ID which you can obtain from the Delight AI dashboard. To learn how to do so, refer to the prerequisites section.
function App() {
return <FixedMessenger appId="YOUR_APP_ID" aiAgentId="YOUR_AI_AGENT_ID" />;
}
When using the fixed messenger, FixedMssenger.Style allows you to customize its appearance and positioning:
margin: Defines the margin around the fixed messenger and its launcher.launcherSize: Defines the size of the launcher button in pixels (width and height are equal).position: Determines which corner of the screen the launcher will appear in. Available options are: start-top, start-bottom, end-top and end-bottom.function App() {
return (
<FixedMessenger>
<FixedMessenger.Style
position={'start-bottom'}
launcherSize={32}
margin={{ start: 0, end: 0, bottom: 0, top: 0 }}
/>
</FixedMessenger>
);
}
The SDK supports two types of user sessions: Manual session for authenticated users and Anonymous session for temporary users.
Session types
1. Manual session (ManualSessionInfo): Use this when you have an authenticated user with a specific user ID and session token.
import { ManualSessionInfo } from '@sendbird/ai-agent-messenger-react';
<FixedMessenger
appId="YOUR_APP_ID"
aiAgentId="YOUR_AI_AGENT_ID"
userSessionInfo={new ManualSessionInfo({
userId: 'user_id',
authToken: 'auth_token',
sessionHandler: {
onSessionTokenRequired: async (resolve, reject) => {
try {
const response = await fetch('new-token-endpoint');
resolve(response.token);
} catch (error) {
reject(error);
}
},
onSessionClosed: () => { },
onSessionError: (error) => { },
onSessionRefreshed: () => { }
}
})}
/>
2. Anonymous session (AnonymousSessionInfo): Use this when you don't have user authentication or want to allow guest access. The server will automatically create a temporary user.
import { AnonymousSessionInfo } from '@sendbird/ai-agent-messenger-react';
<FixedMessenger
appId="YOUR_APP_ID"
aiAgentId="YOUR_AI_AGENT_ID"
userSessionInfo={new AnonymousSessionInfo()}
/>
The messenger view can be programmatically controlled using the state prop:
function App() {
const [opened, setOpened] = useState(true);
return <FixedMessenger appId="YOUR_APP_ID" aiAgentId="YOUR_AI_AGENT_ID" state={{ opened, setOpened }} />;
}
The following are available advanced features.
Build custom messenger UI using AgentProviderContainer:
import { AgentProviderContainer, Conversation } from '@sendbird/ai-agent-messenger-react';
function App() {
return (
<div style={{ height: '400px', border: '1px solid #ccc' }}>
<AgentProviderContainer appId="YOUR_APP_ID" aiAgentId="YOUR_AI_AGENT_ID">
<Conversation />
</AgentProviderContainer>
</div>
);
}
You can predefine customer-specific information such as country, language, or other custom context data to guide the AI agent in providing faster and more accurate responses.
This allows for a more personalized and context-aware interaction experience.
Important: These settings can only be configured during initialization.
<FixedMessenger
appId="YOUR_APP_ID"
aiAgentId="YOUR_AI_AGENT_ID"
// Language setting (IETF BCP 47 format)
// default: navigator.language
language="en-US"
// Country code setting (ISO 3166 format)
countryCode="US"
// Context object for the AI agent
context={{
userPreference: 'technical',
customerTier: 'premium',
}}
/>
The SDK supports multiple languages and allows you to customize UI strings. You can:
For detailed information about localization options and full list of available string sets, refer to our Localization Guide.
FAQs
Delight AI Agent Messenger for React
The npm package @sendbird/ai-agent-messenger-react receives a total of 2,803 weekly downloads. As such, @sendbird/ai-agent-messenger-react popularity was classified as popular.
We found that @sendbird/ai-agent-messenger-react demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
Compromised intercom-client@7.0.4 npm package is tied to the ongoing Mini Shai-Hulud worm attack targeting developer and CI/CD secrets.

Research
Socket detected a malicious supply chain attack on PyPI package lightning versions 2.6.2 and 2.6.3, which execute credential-stealing malware on import.

Research
A brand-squatted TanStack npm package used postinstall scripts to steal .env files and exfiltrate developer secrets to an attacker-controlled endpoint.