React
Quickly embed a customizable chat experience into your React app using the best chat APIs, feature-rich SDKs, and highly customizable components.
import { Chatbox } from '@talkjs/react-components';
import '@talkjs/react-components/default.css';
import { TalkSession } from '@talkjs/core';
import { useEffect } from 'react';
function Chat() {
const appId = '<APP_ID>';
const userId = 'frank';
const otherUserId = 'nina';
const conversationId = 'new_conversation';
const session = getTalkSession({ appId, userId });
useEffect(() => {
session.currentUser.createIfNotExists({ name: 'Frank' });
session.user(otherUserId).createIfNotExists({ name: 'Nina' });
const conversation = session.conversation(conversationId);
conversation.createIfNotExists();
conversation.participant(otherUserId).createIfNotExists();
}, [session, conversationId, otherUserId]);
return (
<div style={{ width: '400px', height: '800px' }}>
<Chatbox
appId={appId}
userId={userId}
conversationId={conversationId}
/>
</div>
);
}

Connect users with a fully customizable chat using our real-time messaging infrastructure that works great with React.
Ship faster by using pre-built components that are highly customizable. Get up and running in just 10 minutes.
All the essential messaging features you need. Replies, mentions, typing indicators, link previews, emojis, and more.
Ship faster, simplify your stack, and save on development costs by using the best chat APIs and a feature-rich React chat SDK. It's all you need to add a fully-featured chat into your app in minutes, instead of months.
<Session appId="t824ba8" userId="pete">
<Chatbox conversation="workshop" className="chatbox" />
</Session>Because implementing TalkJS was as fast and easy as it was, we were able to greenlight and move this project along very quickly. Had we not chosen this path, the feature would have either been delayed, or shelved due to the resources needed to implement it.
The React SDK comes with UI components that are forward-compatible and will keep working on future devices and new features. You have complete control over the styling, the layout, and document structure of the chat messages and the possibility to show metadata.