JetBrains Space
 

(Kotlin) How to Unfurl Links

Last modified: 17 February 2023

Link preview or link unfurling is a great feature that lets users see the content behind a link without actually following it. The preview is shown right in the Space UI and contains a piece of content fetched from the external resource.

Space can show link previews in various contexts: in chat messages, documents, issue descriptions, commit and code review titles. To build the preview, Space uses the info from the page's social meta tags. You can find more details on the requirements on this page.

But what if the page behind the link doesn't provide social tags or requires user authentication? Of course, Space won't be able to show the preview, but you can fix this by creating a Space application. The purpose of the application is to do all this stuff behind the curtains, i.e. authenticate in the external system, fetch the required content, and send it to Space.