Packbase SDK

Profile

TypeScript shapes for profiles, updates, friends, and storage.

Profile

Profile describes a Packbase account. The API always includes id, username, and display_name. The value of display_name can be null. Fields that end in ? can be absent. Use optional chaining such as profile.about?.bio for these fields.

interface Profile {
  emotes?: PackEmote[]
  id: string
  username: string
  display_name: string | null
  badge?: string
  about?: { bio?: string | null; flair?: string }
  space_type?: 'default' | 'custom_free' | 'custom_unrestricted'
  profile_avatar_mature?: boolean
  profile_banner_mature?: boolean
  profile_howls_mature?: boolean
  images?: { avatar?: string; header?: string | null }
  following?: boolean
  muted_by_me?: boolean
  is_staff?: boolean
  is_content_moderator?: boolean
  is_dx?: boolean
  type?: 'REGULAR' | 'REGULAR_DX' | 'BOT' | 'BOT_DX' | 'PRIVILEDGED' | 'HYPER_PRIVILEDGED' | 'ALUMNI'
  created_at?: string
  default_pack?: string | Pack | null
}

The values of about.bio and images.header can be null. null means that Packbase does not have a stored value.

following identifies whether the current signed-in user follows this profile. It can be absent in an anonymous request. Staff flags can also be absent if an endpoint returns a smaller profile summary.

Public profiles expose default_pack as a UUID. pb.me() can expand it to a Pack object. It can be absent or null when no visible default Pack is returned. Narrow the value with typeof profile.default_pack === 'string' before using it.

UpdateProfileInput

pb.me.update() accepts this object. Each field is optional because the method makes a partial update. Include only the values that you want to change.

interface UpdateProfileInput {
  display_name?: string
  username?: string
  about?: { bio?: string }
  space_type?: 'default' | 'custom_free' | 'custom_unrestricted'
  profile_avatar_mature?: boolean
  profile_banner_mature?: boolean
  profile_howls_mature?: boolean
  images?: { avatar?: string; header?: string }
}

Image updates accept base64 data URLs. Pass the complete data URL, including its MIME type, to images.avatar or images.header.

The three maturity flags are independent. They identify mature avatars, banners, and howls in existing profile responses. emotes contains resolved image metadata for custom tokens in display names and bios. It remains usable by readers outside the source Pack. See Pack custom emotes.

pb.me.update() returns UpdateProfileResult. It contains an id, optional saved fields, and optional emote metadata. A saved about.bio is returned as the flat bio field. Image fields contain the saved image references. It is not a new full Profile. Call pb.me() for the full current profile.

Friends and storage

pb.me.friends() returns FriendsResponse:

interface FriendsResponse {
  count: number
  friends: FriendProfile[]
  message?: string
}

pb.me.storage() returns StorageUsage:

interface StorageUsage {
  totalBytes: number
  fileCount?: number
  tier?: string
  error?: string
}

Import

import type {
  Profile,
  UpdateProfileInput,
  UpdateProfileResult,
  FriendsResponse,
  StorageUsage,
} from '@packbase/sdk-ts'

muted_by_me?: boolean reports only whether the authenticated viewer muted this profile. It never identifies other muters or incoming blocks. Muted profiles remain readable; blocked profiles use the ordinary 404 response. Owner-only management records are described in visibility.

On this page