
Security News
OWASP 2025 Top 10 Adds Software Supply Chain Failures, Ranked Top Community Concern
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.
@mergeapi/react-agent-handler-chat
Advanced tools
A React hook wrapper for Agent Handler Chat widget. For the core module and the main documentation, see agent-handler-chat.
This package is usually only updated when there are breaking changes to the function contract, such as new arguments or return types. Otherwise, the package should remain stable.
package.jsonnpm publish (Will need to setup credentials through npm login or github token)import React from 'react';
import { useAgentHandlerChat } from '@mergeapi/react-agent-handler-chat';
function App() {
const { openChat, closeChat, isReady, error } = useAgentHandlerChat({
authToken: 'your-auth-token',
useDummyResponse: true,
parentContainerID: 'chat-container',
onSuccess: (message) => {
console.log('Message sent:', message);
},
onValidationError: (error) => {
console.error('Validation error:', error);
},
onReady: () => {
console.log('Chat widget is ready!');
},
});
if (error) {
return <div>Error loading chat widget: {error.message}</div>;
}
return (
<div>
<h1>My App with Chat</h1>
<div id="chat-container" style={{ width: '400px', height: '600px' }} />
{isReady && (
<div>
<button onClick={openChat}>Open Chat</button>
<button onClick={closeChat}>Close Chat</button>
</div>
)}
</div>
);
}
export default App;
import React from 'react';
import { useAgentHandlerChat } from '@mergeapi/react-agent-handler-chat';
function App() {
const { openChat, closeChat, isReady } = useAgentHandlerChat({
authToken: 'your-auth-token',
parentContainerID: 'chat-container',
customization: {
title: 'Customer Support',
blankState: {
heading: 'How can we help you today?',
subtitle: 'Ask us anything about our products and services'
},
promptSuggestions: [
'What are your business hours?',
'How do I reset my password?',
'Tell me about pricing'
]
},
onReady: () => console.log('Chat ready'),
});
return (
<div>
<h1>Customer Support Chat</h1>
<div id="chat-container" style={{ width: '400px', height: '600px' }} />
{isReady && <button onClick={openChat}>Open Chat</button>}
</div>
);
}
authToken (string): Authentication token for backend API callstenantConfig (object): Configuration for custom API base URL
apiBaseUrl (string): Override the default API base URLuseDummyResponse (boolean): If true, always returns "You're absolutely right" (default: false)parentContainerID (string): ID of the DOM element to mount the chat widget inonReady (function): Callback when widget is readyonSuccess (function): Callback when a message is successfully sentonValidationError (function): Callback when validation errors occurcustomization (object): Customize the appearance and behavior of the chat widget
title (string): Title displayed in the header (default: "Playground")blankState (object): Customize the empty state when no messages exist
icon (React.ReactNode): Custom icon to display (default: Send icon)heading (string): Main heading text (default: "Start a Conversation")subtitle (string): Subtitle text (default: "Test your tool packs in a sandbox environment. Type a message below to begin.")promptSuggestions (string[]): Array of suggested prompts to display as clickable buttons in the blank stateFAQs
A React hook wrapper for Agent Handler Chat.
We found that @mergeapi/react-agent-handler-chat demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 9 open source maintainers 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.

Security News
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.