
Security News
Deno 2.6 + Socket: Supply Chain Defense In Your CLI
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.
react-chat-agent
Advanced tools
React Chat Agent - A production-ready chat provider with WebSocket support
Clean, production-ready React chat component with external session/token management.
npm install react-chat-agent
Then import the ui in your app:
import 'react-chat-agent/ui.css';
import {
ChatProvider,
ChatPanel,
tokenManager,
sessionManager
} from 'react-chat-agent';
function App() {
// 1. Configure token refresh
tokenManager.setRefreshCallback(async (refreshToken) => {
const res = await fetch('/api/token/refresh', {
method: 'POST',
body: JSON.stringify({ refreshToken })
});
return await res.json(); // { accessToken, refreshToken, expiresIn }
});
// 2. Configure session creation
sessionManager.setCreateSessionCallback(async () => {
const res = await fetch('/api/session/create', { method: 'POST' });
return await res.json(); // { sessionId, accessToken, refreshToken, expiresIn }
});
// 3. Initialize tokens
tokenManager.setTokens({
sessionId: 'your-session-id',
accessToken: 'your-token',
refreshToken: 'your-refresh-token',
expiresIn: 900
});
return (
<ChatProvider useWebSocket={false}>
<ChatPanel
onCreateSession={async () => await sessionManager.createSession()}
config={{
chatUrl: 'https://api.example.com/chat',
historyUrl: 'https://api.example.com/history'
}}
/>
</ChatProvider>
);
}
See INTEGRATION_GUIDE.md for complete documentation including:
import {
ChatProvider, // Context provider
ChatPanel, // Main chat component
useChatContext, // Hook to access chat state
tokenManager, // Token lifecycle management
sessionManager, // Session lifecycle management
chatApi, // API client
streamService, // Stream handler
webSocketService // WebSocket client
} from 'react-chat-agent';
examples/App.jsx - Simple SSE exampleexamples/App-with-session.jsx - Complete session management exampleMIT
FAQs
React Chat Agent - A production-ready chat provider with WebSocket support
The npm package react-chat-agent receives a total of 641 weekly downloads. As such, react-chat-agent popularity was classified as not popular.
We found that react-chat-agent 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.

Security News
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.

Security News
New DoS and source code exposure bugs in React Server Components and Next.js: what’s affected and how to update safely.

Security News
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.