@fedikit/webfinger
v0.0.1-alpha.7
Published
Building Blocks for Fediverse.
Downloads
2
Readme
@fedikit/webfinger
Implement Webfinger in a simple way.
Usage
/.well-known/webfinger
(simpleWebfinger)
import {
simpleWebfinger,
type SimpleWebfingerHandler,
} from '@fedikit/webfinger'
import { Hono } from 'hono'
const app = new Hono()
const handler = ({ user, host }) => `https://${host}/users/${user}`
// GET https://example.com/.well-known/webfinger?resource=acct:[email protected]
// {
// "subject": "acct:[email protected]",
// "aliases": ["https://example.com/users/carol"],
// "links": [
// {
// "href": "https://example.com/users/carol",
// "rel": "http://webfinger.net/rel/profile-page",
// "type": "text/html"
// },
// {
// "href": "https://example.com/users/carol",
// "rel": "self",
// "type": "application/activity+json"
// }
// ]
// }
app.get(
'.well-known/webfinger',
() => simpleWebfinger(handler),
)