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.
- Link unfurls require an SDK compatibility range that excludes versions before
0.16.0and admits a version covered by the host's renderer bootstrap attestation. Their locked bootstrap assets must match that attestation exactly. The TAP host requirement is2.13.2or newer.
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.