Skip to main content
Apps and people live on different domains: Do not derive one from the other, and do not build them from window.location: inside a native shell your page may be running on a host nobody else can reach.

Routing

The same bundle is mounted at / on the app’s host and at /<slug> on a profile. The host tells you which.
Never redirect a /<slug> path to /<slug>/ or re-mount it yourself. An app can legitimately have a route that shares its slug’s name.
Use userPageUrl for anything a person will paste elsewhere: a share sheet, a copied link, a preview card. When the page is already the owner’s own user page, it keeps the current origin, so a profile reached through a custom domain shares as that domain.

getHostnameUsername

Returns the profile owner’s username: from the injected app data when present, otherwise from the first label of the hostname. On localhost it returns a fixed development name. Prefer getAppUser() in new code.