Link previews

Whenever a user types a URL in one of their messages, TalkJS can generate a link preview for that URL that displays a website or file thumbnail. Link previews are automatically enabled for user messages, but not for system messages.

Full preview

By default, the link preview shows a full, large preview of a website thumbnail.

A message with a large link preview of the website talkjs.com

If you're using the classic React SDK or classic JavaScript SDK, then you can also customize things to display a smaller, more compact link preview. Check out the Control link previews guide.

Embedded video or audio player

For links with video or audio files, such as on YouTube or Spotify, the link preview provides an embedded player. For example:

A message with a preview of a YouTube video, including a play button

No preview

When no link preview is available for a website, then TalkJS renders the message without a link preview:

A message with a URL without a link preview

Note that if you suppress link sharing in your chat, then neither the URL nor the link preview appears in the message.