Providers

Sites whose API knows more than their pages say, and what each adds to a card.

How they're asked

Providers are asked in the order below. The first one that recognizes the address and gets an answer wins, and its name goes in the card's source. When its API doesn't answer (a rate limit, a private repository, a server that isn't Mastodon after all), the page is read instead.

The providers setting lists the ones to ask, by name. [] reads every address as a page:

jscard = unfurl( link, { providers: [ "github", "youtube" ] } )

The providers

sourceAddresses
githubrepositories, issues, pull requests
youtubewatch?v=, youtu.be/, /shorts/, /live/, /embed/
vimeovimeo.com/123, channels, player.vimeo.com/video/123
npmnpmjs.com/package/name, scoped packages, /v/version
forgeboxforgebox.io/view/slug
blueskybsky.app/profile/handle/post/rkey
reddit/r/sub/comments/id, redd.it/id
wikipedia<lang>.wikipedia.org/wiki/Title, mobile too
mastodonhttps://server/@user/123 on any server

details

Each provider puts its own fields in the card's details.

github

A repository:

{ kind: "repo", fullName, description, language, stars, forks,
  openIssues, pushedAt, archived }

An issue or pull request:

{ kind: "issue" | "pull", repo, number, state, author, comments,
  createdAt, labels }

A pull request also has additions, deletions and changedFiles. state is open, closed, notPlanned, draft or merged.

youtube: { kind: "video", id }. YouTube's oEmbed has no description.

vimeo: { kind: "video", id, duration }

npm

{ kind: "package", registry: "npm", name, version, description, license,
  homepage, repository, weeklyDownloads }

weeklyDownloads is -1 when it isn't known.

forgebox

{ kind: "package", registry: "forgebox", name, title, version, packageType,
  installs, downloads, hits, homepage, repository }

bluesky

{ kind: "post", network: "bluesky", handle, did, likes, reposts,
  replies, quotes, labelled }

reddit

{ kind: "post", network: "reddit", subreddit, score, comments, link,
  nsfw, spoiler }

wikipedia: { kind: "article", lang, title, shortDescription, pageType }

mastodon

{ kind: "post", network: "mastodon", account, replies, boosts, favourites,
  contentWarning, sensitive }

Sensitive posts

Posts are careful about what they show:

  • A Mastodon post behind a content warning gets the warning as its description and the author's avatar as its image.
  • A Bluesky post labelled adult or graphic gets no media image.
  • A Reddit post marked NSFW or spoiler gets no media image.

Notes on particular sites

GitHub allows 60 API calls an hour without a token. Set githubToken for 5,000. The token goes to GitHub's API only, never to wherever a request redirects.

Reddit refuses or rate-limits many servers that ask without signing in, so its cards fall back to the page more often than the others.

Wikipedia is read from Wikimedia's /api/rest_v1/page/summary endpoint, which Wikimedia lists as the supported route for summaries.

Endpoints

The endpoints setting holds each provider's API address. Override one at a time, for a GitHub Enterprise server or for tests:

jscard = unfurl( link, { endpoints: { github: "https://github.example.com/api/v3" } } )
KeyDefault
githubhttps://api.github.com
youtubehttps://www.youtube.com/oembed
vimeohttps://vimeo.com/api/oembed.json
npmhttps://registry.npmjs.org
npmDownloadshttps://api.npmjs.org
forgeboxhttps://forgebox.io/api/v1
blueskyhttps://public.api.bsky.app
reddithttps://www.reddit.com
wikipedia"", meaning each article's own https://<lang>.wikipedia.org

Providers and oEmbed endpoints are fetched through the same checks as pages; see Security.