handleOfDid
A visitor's handle, as their DID document says it (for showing who's signed in), or their DID.
import { didDocument } from "#codebase/tcmts/atproto"; export async function handleOfDid(did: string): Promise<string> { try { const aka = (await didDocument(did)).alsoKnownAs?.find((a) => a.startsWith("at://")); return aka ? aka.slice(5) : did; } catch { return did; } }