Link Unfurl
@theaiplatform/miniapp-sdk/link-unfurl defines the public link.unfurl contribution and renderer payload. A contribution claims one exact HTTPS hostname and one bounded path template. Create another contribution for each additional URL pattern.
Define and Mount an Unfurl
The host, not the package, creates the payload. It includes the normalized link preview, path captures, and a fixed link target. The renderer must treat every value as display data. The canonical link and removal controls remain host-owned outside the iframe.
Matching and selection
- Only
httpslinks are eligible. hostnameis lowercase ASCII without a scheme, port, path, or wildcard.pathTemplatecontains 1–16 exact segments. A segment is either a URL-safe literal or a named capture such as:number.- If more than one authorized package matches, the host does not choose between them and falls back to its generic preview.
- Package unfurls require Miniapp SDK
0.16.0and a TAP host compatible with2.13.2or newer. Rebuild inline-renderer packages created with an earlier SDK because their bootstrap lacks the enforced WebRTC boundary.
The host tries an authorized package renderer before its built-in and generic presentation. A missing, ambiguous, invalid, or failed package renderer safely falls back to the existing built-in or generic preview.