hubServices
uses process
The services a visitor's browser uses, and the hub reads follows from ($TCM_APPVIEW, else Bluesky's).
import { directory } from "#codebase/tcmts/atproto"; import type { HubServices } from "#codebase/tcmts/hub"; export async function hubServices(): Promise<HubServices> { const dir = directory(); return { appview: process.env.TCM_APPVIEW?.replace(/\/+$/, "") || dir || "https://public.api.bsky.app", plc: dir || "https://plc.directory", }; }