whoami
The namespace, space and permissions the credential carries — the cheapest round trip that proves a key.
whoami(): Promise<Whoami>Returns
FieldTypePresence
namespacestringalwaysThe namespace the credential belongs to. It comes from the key — you cannot select it per request on this tier.
spaceIdstringalwaysThe space the key reads and writes.
permissionsPermissionsalwayscanEncode, canRecall, canPlan, canReason, canForget, canAdmin — booleans. Check them before offering an action rather than discovering the refusal at call time.
Example
const me = await brain.whoami();
if (!me.permissions.canForget) hideDeleteButton();The wire tier answers this without a round trip
A wire client already knows: the handshake returns the namespace, the bound
space and the permissions, and the client exposes them as connection
properties. There is no wire whoami because there is nothing to ask.
See also
Was this page helpful?