React

Build chat into your React app with TalkJS

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> ); }
Avatar
Hey, I'm trying to lift state up from a child component, but I'm getting undefined errors. Any ideas?
8m ago
Avatar
Are you passing the state and the setState function correctly as props?
10m ago
Avatar
I think so, yes.
7m ago
OK hand emoji
Thinking emoji
Avatar
Maybe you're not binding the handler in the constructor. That might be the issue.
2m ago
Avatar
Say something...
Avatar
Avatar
4
AI integration strategy
Andrea, Robert, Nikki, Filip
Avatar
Andrea
10m ago
Hey team, how do you think we can integrate AI into our project?
Avatar
Robert
8m ago
Maybe we can use AI for data analysis. It can help us find trends faster.
Avatar
Nikki
7m ago
Good idea @Robert. What about automating customer support? AI chatbots could handle common queries.
Avatar
Filip
2m ago
00:15
1x
Say something...
React SDK
Connect users with a fully customizable chat using our real-time messaging infrastructure that works great with React.
Drop-in chat UI
Ship faster by using pre-built components that are highly customizable. Get up and running in just 10 minutes.
Fully-featured
All the essential messaging features you need. Replies, mentions, typing indicators, link previews, emojis, and more.
Classtime
Decathlon
Riot Games
Hyundai

Working with React and TalkJS

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>
Styleseat logo
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.
Sean Elliot
Engineering Manager, Styleseat

Ready-made chat components you can customize

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.