Python
Quickly embed a customizable chat experience into your Python app using the best chat APIs, feature-rich SDKs, and a highly customizable pre-built UI.
.message {
white-space: normal;
overflow: hidden;
border-radius: 0.75rem;
border-width: 1px;
border-style: solid;
word-wrap: break-word;
position: relative;
display: inline-block;
max-width: calc(100% - 6rem - 0.25rem - 0.25rem);
border-color: #F2F2F2;
background-color: #F2F2F2;
color: #171717;
}
.has-avatar-spacer .message {
max-width: calc(100% - 3rem - 0.25rem - 0.25rem);
}
.by-me .message {
border-color: #171717;
background-color: #171717;
color: #fff;
margin-right: 0.50rem;
}


Connect users with a fully customizable chat using our real-time messaging infrastructure that works great with your Python backend.
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.
Use our fully-featured JavaScript SDK to integrate chat on your website or mobile app. It comes with a customizable, pre-built chat UI, so you can ship faster with less effort and maintain full control over the user experience.
Manage users, conversations, and messages from your backend with the TalkJS REST API. Ideal for server-side workflows and data control.
from flask import Flask, render_template
app = Flask(__name__)
@app.route("/")
def render_talkjs():
user = { # Create a user, or fetch user data from your database
"id": "123456",
"name": "Alice",
"email": "alice@example.com",
"photoUrl": "https://talkjs.com/images/avatar-7.jpg",
"welcomeMessage": "Hey there! How are you? :-)",
}
app_id = "abcdef123" # Replace with your own app ID
conversation_id = "conversation_1"
other = { # Create a user, or fetch user data from your database
"id": "654321",
"name": "Sebastian",
"email": "sebastian@example.com",
"photoUrl": "https://talkjs.com/images/avatar-4.jpg",
"welcomeMessage": "Hey there! How can I help?",
}
return render_template(
"talkjs.html", user=user, app_id=app_id, conversation_id=conversation_id, other=other
)We were able to offload all messaging to TalkJS — hugely simplifying our development of an otherwise complex stack.
The chat UI comes with three different layouts—that are highly customizable—which you can mix and match to suit your needs. You have complete control over the styling, the layout, and document structure of the chat messages and the possibility to show metadata.
The TalkJS Inbox shows the chat history on the left, selected conversation on the right. It's designed to act as the messaging center of your app, usually living on its own page.
The TalkJS Chatbox is just the right half of the Inbox UI mode. It takes up less space and is designed to be embedded in your app near an order confirmation, a booking, or user profile.
You can also show a conversation in a popup that only shows up when the user clicks a button somewhere. When shown, the popup is positioned on the bottom right of your page.