Shared types

interface App

Holds information about your TalkJS app.

Properties

custom
: Record<string, string>

Custom data set for this app.

This can be configured from your TalkJS dashboard.

defaultLocale
: string

The default locale.

This can be configured from your TalkJS dashboard.

id
: string

Your app's unique TalkJS ID. You can find it on the Settings page of the TalkJS dashboard.

name
: string

The name of your app.

interface CommonChatboxProps

A collection of props that's shared by every themed component used in the Chatbox UI.

Properties

app
: App

Holds information about your TalkJS app.

chatbox
: Chatbox

The chatbox instance itself.

conversation
: ConversationSnapshot

The conversation displayed in the chatbox.

currentUser
: UserSnapshot

The user that mounted this chatbox.

Describes the capabilities of the current device.

participants
: ParticipantSnapshot[]

A list of participants that are part of the conversation that's currently being shown.

session
: TalkSession

The underlying TalkJS session object that handles sending and receiving chat data.

A translation object which holds localized strings for internationalization purposes.

theme
: Theme

The theme object that the chatbox's is currently using.

Tells you which participants are currently typing

themeCustom (optional)
: any

Arbitrary custom data passed down to the theme.

The data that you pass to ChatboxProps​.themeCustom will show up here so that you can use it from within theme components.

interface CommonConversationListProps

A collection of props that's shared by every themed component used in the ConversationList UI.

Properties

app
: App

Holds information about your TalkJS app.

conversationList
: ConversationList

The conversation list instance itself.

currentUser
: UserSnapshot

The user that mounted this chatbox.

Describes the capabilities of the current device.

session
: TalkSession

The underlying TalkJS session object that handles sending and receiving chat data.

A translation object which holds localized strings for internationalization purposes.

theme
: Theme

The theme object that the chatbox's is currently using.

themeCustom (optional)
: any

Arbitrary custom data passed down to the theme.

The data that you pass to ConversationListProps​.themeCustom will show up here so that you can use it from within theme components.

interface Coordinates

Properties

latitude
: number
longitude
: number

interface DeviceFeatures

Describes the capabilities of the current device.

Properties

isMobile
: boolean

True if the user agents reports the current device as a mobile/tablet.

supportsEmojiPicker
: boolean

True if the browser supports IndexedDB, which the emoji picker depends on.

interface MessagePermissions

A set of permissions the current user has for a given message.

The values of these permissions come from the user's role.

Properties

canAddReaction
: boolean

True if the user has the ability to add an emoji reaction to the given message.

canDeleteMessage
: boolean

True if the user has the ability to delete the given message.

canEditMessage
: boolean

True if the user has the ability to edit the given message.

canLeaveConversation
: boolean

True if the user has the permission to leave a given conversation.

canMarkConversationAsUnread
: boolean

True if the user has the permission to mark the given conversation as unread.

canMention
: boolean

True if mentions are enabled.

canReplyToMessage
: boolean

True if the user has the ability to reply to the given message.

canSendVoiceMessage
: boolean

True if voice messages are enabled.

canShareFile
: boolean

True if file sharing is enabled.

canShareLocation
: boolean

True if location sharing is enabled.

showOnlineStatus
: boolean

True if online status indicators are enabled.

showTypingIndicator
: boolean

True if typing indicators are enabled.

type MessageStatus

The current status of the message.

This type can have one of these values:

- "sending" - Message is still being sent to the server. a loading spinner is typically shown in chat UIs.

- "sent" - Message has arrived on the server. Typically represented using a single checkmark in chat UIs.

- "everyoneRead" - Everyone in the conversation has read this message. Typically represented using two checkmarks in chat UIs.

interface Theme

A theme can be used to customize the appearance & behavior of your TalkJS Chatbox and/or ConversationList.

The implementation of TalkJS's default theme is open-source and available on Github.

Properties

AudioBlock
: React.ComponentType<AudioBlockProps>
Avatar
: React.ComponentType<AvatarProps>
ChatHeader
: React.ComponentType<ChatHeaderProps>
CompactMessageContent
: React.ComponentType<CompactMessageContentProps>
ConversationImage
: React.ComponentType<ConversationImageProps>
ConversationListItem
: React.ComponentType<ConversationListItemProps>
FileBlock
: React.ComponentType<FileBlockProps>
GroupChatImage
: React.ComponentType<GroupChatImageProps>
Icon
: React.ComponentType<IconProps>
ImageBlock
: React.ComponentType<ImageBlockProps>
LocationBlock
: React.ComponentType<LocationBlockProps>
Message
: React.ComponentType<MessageProps>
MessageActionMenu
: React.ComponentType<MessageActionMenuProps>
MessageDivider
: React.ComponentType<MessageDividerProps>
MessageField
: React.ComponentType<MessageFieldProps>
MessageListFooter
: React.ComponentType<MessageListFooterProps>
ReferencedMessage
: React.ComponentType<ReferencedMessageProps>
ReplyBar
: React.ComponentType<ReplyBarProps>
TextBlock
: React.ComponentType<TextBlockProps>
TimeAgo
: React.ComponentType<TimeAgoProps>
VideoBlock
: React.ComponentType<VideoBlockProps>
VoiceBlock
: React.ComponentType<VoiceBlockProps>

interface Translation

Translation object

Properties

locale
: string

interface UserPermissions

A set of permissions for the current user.

The values of these permissions come from the user's role.

Properties

canLeaveConversation
: boolean

True if the user has the permission to leave a given conversation.

canMarkConversationAsUnread
: boolean

True if the user has the permission to mark the given conversation as unread.

canMention
: boolean

True if mentions are enabled.

canSendVoiceMessage
: boolean

True if voice messages are enabled.

canShareFile
: boolean

True if file sharing is enabled.

canShareLocation
: boolean

True if location sharing is enabled.

showOnlineStatus
: boolean

True if online status indicators are enabled.

showTypingIndicator
: boolean

True if typing indicators are enabled.