Skip to main content
Sublay exposes two user type variants depending on context: User (public profile) and AuthUser (the authenticated user’s own data). All SDK hooks and API endpoints return one of these two types.

User

The User type is returned when fetching another user’s public profile. Sensitive and internal fields are excluded.
PropertyTypeDescription
idstringUnique user identifier (UUID).
foreignIdstring | nullYour system’s user ID if this user was created via external auth.
projectIdstringThe project this user belongs to.
role"admin" | "moderator" | "visitor"The user’s role within the project.
namestring | nullDisplay name.
usernamestring | nullUnique username handle.
avatarstring | nullAvatar image URL.
avatarFileIdstring | nullID of the managed avatar file record.
bannerFileIdstring | nullID of the managed banner file record.
avatarFileFile | nullPopulated avatar file object when include contains "files".
bannerFileFile | nullPopulated banner file object when include contains "files".
biostring | nullShort biography (max 300 characters).
birthdateDate | nullUser’s date of birth.
locationGeoPoint | nullGeoJSON point representing the user’s location.
metadataRecord<string, any>Custom key-value data for your project (max 10 KB).
reputationnumberThe user’s overall reputation total — the sum of all their reputation buckets across every space. Always present. See Reputation.
spaceReputationnumberOpt-in. The user’s reputation in a specific space, added only when an endpoint is called with the spaceReputationId query param. See Reputation.
createdAtDateTimestamp when the account was created.

GeoPoint

PropertyTypeDescription
type"Point"GeoJSON geometry type. Always "Point".
coordinates[number, number]Longitude and latitude, in that order.

AuthUser

The AuthUser type is returned to the currently authenticated user about themselves. It extends User with additional fields not visible to others. All User fields above are included, plus:
PropertyTypeDescription
emailstring | nullThe user’s email address.
isVerifiedbooleanWhether the user’s email address has been verified.
isActivebooleanWhether the account is currently active.
lastActiveDateTimestamp of the user’s last activity.
updatedAtDateTimestamp when the account was last modified.
authMethodsstring[]Authentication methods linked to this account (e.g. ["password", "google"]).
suspensionsSuspension[]Array of active or past suspensions.

Suspension

PropertyTypeDescription
reasonstring | nullThe reason provided for the suspension.
startDateDateWhen the suspension began.
endDateDate | nullWhen the suspension ends, or null for indefinite.

Includes

Some endpoints accept an include parameter that populates additional fields. Pass "files" to populate avatarFile and bannerFile with File objects.

Reputation

Every user object always carries reputation — the maintained sum of the user’s reputation across all spaces. When the optional reputation bundle is installed, you can additionally read a user’s reputation in a specific space via the spaceReputationId query param, which adds a spaceReputation field to each returned user. See the Reputation data model for the full opt-in read contract.

See Also