Our JavaScript SDK comes with a pre-built chat UI that you can use right away. The UI is forward-compatible so it will keep working on future devices, new features, and future browser bugs. You can style it with TalkJS Themes or build custom elements like the chat header if needed.
1function App() {2 const me = {3 id: "79302",4 name: "Nina Caldwell",5 email: "nina.caldwell@example.com", // for offline6 };78 const botUser = {9 id: "bot",10 name: "Helpful Bot 🤖",11 };1213 const syncUser = useCallback(() => {14 return new Talk.User(me);15 }, []);1617 const syncConversation = useCallback((session) => {18 // Add users to the conversation19 const conversation = session.getOrCreateConversation(20 Talk.oneOnOneId(me, botUser)21 );22 conversation.setParticipant(session.me);23 conversation.setParticipant(new Talk.User(botUser));24 return conversation;25 }, []);2627 return (28 <Session appId="<APP_ID>" syncUser={syncUser}>29 <Chatbox syncConversation={syncConversation} className="chat-container" />30 </Session>31 );32}
Tune the look and feel of your UI
It's easy to customize anything you'd prefer to change from the default TalkJS theme. Our built-in theme editor lets you control the style, layout, and even what data is displayed.
All the APIs you need for deeper integration
When the default experience isn't enough, TalkJS has everything you need to build custom integrations. Get notified for each new message via webhooks, control your data with the REST API, or set up email notifications. And if you're having any trouble building that integration, you can instantly chat with a TalkJS developer on our support chat to get some help with your code.