import { Chatbox } from '@talkjs/react-components';
import '@talkjs/react-components/default.css';
import { getTalkSession } 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 (
<Chatbox
style={{ width: "400px", height: "600px" }}
appId={appId}
userId={userId}
conversationId={conversationId}
/>
);
}





We needed chat and didn’t want to build it ourselves because it needs to be really great. The TalkJS team is laser-focused on chat, and we’re focused on building a great auction marketplace.