fedify Main Island · First Gate

The Webfinger Gate

ja· en· ko
If you're new hereA phone book. From a handle like @name@which-island, it finds that person's real address (URL).

One handle finds anyone in the universe. Write @friend@mastodon.social and your app can look up their real address (URL), no matter which server they live on. To do it yourself, you call lookupWebFinger() once—you never have to learn how the phone book works underneath.

This package is only the visiting half. The side that answers at /.well-known/webfinger when someone visits you lives in the Main Hall. This gate is for those heading out.

Highlights

  • About 1,400 lines in all. One of the smallest packages on the island.
  • One public entrance only: lookupWebFinger() (lookup.ts). Tune its behavior with LookupWebFingerOptions.
  • ResourceDescriptor and Link in jrd.ts are the exact shape of the placard WebFinger hands back.

A passage from the sutra

export interface ResourceDescriptor {
  subject?: string;
  aliases?: string[];
  properties?: Record<string, string | null>;
  links?: Link[];
packages/webfinger/src/jrd.ts L5-L9— The shape of the placard received at the gate

Try it yourself

Type an address and look it up — this queries the real phone book.

Floor plan

packages/webfinger/src/lookup.ts
The lookupWebFinger() client
packages/webfinger/src/jrd.ts
JRD types: ResourceDescriptor and Link

Neighboring rooms

Outside links