> Fetch clean Markdown by appending `.md` to any page URL under https://signalwire.com/docs or requesting it with the HTTP header `Accept: text/markdown`. The root index at https://signalwire.com/docs/llms.txt lists the available documentation indexes. # getMessages * **getMessages**(`params`): `Promise<{ cursor: PagingCursor; messages: ChatMessageEntity[] }>` See [PagingCursor documentation](/docs/browser-sdk/v3/js/reference/chat/client#paginationcursor) and [ChatMessageEntity documentation](/docs/browser-sdk/v3/js/reference/chat/chat-message-entity) for more details. Returns the list of messages that were sent to the specified channel. ## Parameters **`params`** `object` — required Configuration object for getting messages --- **`params.channel`** `string` — required Channel for which to retrieve the messages. --- **`params.cursor`** `PagingCursor` Cursor for pagination. See [PagingCursor](/docs/browser-sdk/v3/js/reference/chat/client#paginationcursor) for more details. --- ## Returns `Promise<{ cursor: PagingCursor; messages: ChatMessageEntity[] }>` See [PagingCursor documentation](/docs/browser-sdk/v3/js/reference/chat/client#paginationcursor) and [ChatMessageEntity documentation](/docs/browser-sdk/v3/js/reference/chat/chat-message-entity) for more details. ## Example ```js const m = await chatClient.getMessages({ channel: "chan1" }); m.messages.length; // 23 m.messages[0]; // the most recent message m.messages[0].member; // the sender m.messages[0].content; // the content m.messages[0].meta; // the metadata (if any) m.cursor.next; // if not null, there are more messages. // Get the next page using the cursor const next = await chatClient.getMessages({ channel: "chan1", cursor: { after: m.cursor.after, }, }); ```