Web SDK
  • Home
  • Overview
  • Getting started
  • References
    • Authentication
    • Account
      • Users
    • Notifications
    • Bookmark
    • 2FA
    • Collection
    • Connection filters
    • Feed
    • File Upload
    • Invite
    • Messaging
    • Payment
    • Reviews
    • Search
    • Verification
      • Supported document type
      • List of expected ISO countries
    • Wallet
      • Withdrawal
  • Tutorial
  • Web API
Powered by GitBook
On this page
  • IChatConversation
  • IChatMessage
  • Fetch message history
  1. References

Messaging

PAKT SDK provides the messaging feature to communicate both ways, this feature provides messaging history.

The list of user messages whether as sender or receiver is listed.

The authenticated user jwt token is required to fetch the chat history.

To use the chatting socket feature, call the API URL of the chainsite.

Returns IChatConversation

IChatConversation

Field
Description
Type

_id

Identifier for the Chat Conversation record

string

type

The type of conversation

recipients

Details of the user(s) in the chats

string[] | IUser[]

messages

List of chats record or the identification of the chat record

string[] |

IChatMessage

IChatMessage

Field
Description

_id

Identification for the chat message record

string

user

Details of the user who created the message

string | IUser

type

string

conversation

Identifier for the comment communication

string | IChatConversation

mediaId

Identifier for a file uploaded for the message

string | IFile

content

The discussion of the message

string

quotedContent

When a user seeks to reply directly to a message, this field is populated with the message to be replied

string

quotedContentId

Identifier of the message quoted for reply

string | IChatMessage

mediaType

The type of media uploaded

string

seen

Identifier to note that the message is received and read by the recipient

string

readBy

Idenifier that contains the _id of users who read the message

string[]

Fetch message history

export const fetchMessagesHistory = async (authToken: string) => {
  const history: ResponseDto<IChatConversation> = await init.chat.getUserMessages(authToken);
};
PreviousInviteNextPayment

Last updated 11 months ago