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>
);
}
A chat API (Application Programming Interface) is a set of tools and endpoints that lets you add messaging features to apps or websites. It handles complex tasks like sending messages, storing chat history, and showing read receipts, so you can focus on your product without building chat infrastructure from scratch.
TalkJS provides a developer-friendly chat API that lets you manage users, conversations, and messages through REST and JavaScript APIs. You can use it with your own UI or combine it with our pre-built chat components.
You can get your secret key to work with the REST API from your TalkJS dashboard. Go to Settings, to the section Secret keys, and copy your key.
TalkJS is free for development and always will be. During development you have access to all features on the paid plans—perfect for testing and building the exact chat experience your users want. Once you go live and add real users to your chat, you’re required to subscribe to a plan. Check out the Pricing page for details.
Yes! TalkJS is ideal for adding real-time chat to any website. Whether you're building a marketplace, a SaaS platform, or a customer support tool, our web chat API gives you full control over how messaging works on your site.
Absolutely. TalkJS works seamlessly in mobile apps built with React Native, Cordova, Capacitor, or any framework that supports WebView or JavaScript. You can also use native push notifications for a full in-app messaging experience.
TalkJS gives you full programmatic control, real-time messaging, built-in moderation, and chatbot support. You can work with powerful APIs and SDKs, paired with clean docs and tutorials. Whether you’re building for web or mobile, TalkJS helps you ship faster.
Certainly. TalkJS is ideal for live chat, and the JavaScript Data API gives you all the real-time messaging data you need—including support for typing indicators, read receipts, and online presence.
Yes. You can use webhooks or the REST API to connect TalkJS conversations with your AI or LLM backend. This makes it easy to power custom chat assistants, helpdesk bots, or intelligent responders.