Packbase SDK

pb.me

Fetch and update the authenticated profile, settings, friends, packs, badge, and storage usage.

pb.me is the resource for the current signed-in account. Each method on this page requires a valid browser session or API key. Use pb.profiles(username) if you require only a public profile.

Use pb.me.connections to discover providers and manage external account authorization. It supports OAuth and custom methods. pb.me.connections.fluxer supplies typed Fluxer methods. See Packchat for community linking and read-only chat.

Fetch the current user

const  = await .()

.(.)
.(.)

pb.me() sends GET /user/me and returns Promise<Profile>.

Update the profile

const  = await ..({
  : 'New Display Name',
  : { : 'Updated bio text' },
  : { : 'data:image/png;base64,iVBORw0KGgo...' },
  : 'custom_free',
})

This is a partial update. Include only the fields that you want to change. Supported fields are display_name, username, about.bio, space_type, images.avatar, images.header, profile_avatar_mature, profile_banner_mature, and profile_howls_mature. Image fields accept complete base64 data URLs. The response contains the fields that the server wrote. It does not contain a new full profile. Call pb.me() after the update if you require the full result.

Settings

const  = await ..()
await ..({ : 'gallery', : 'paged' })

Call settings() with no argument to read the settings. Call it with an object to update them. The read result is Record<string, unknown>. Decode each key that you use. Do not cast the full record.

const  = await ..()
const  = (, {
  : (): 'list' | 'gallery' => {
    if ( !== 'list' &&  !== 'gallery') throw new ('Invalid feed layout')
    return 
  },
})

To cancel a settings read without confusing request options with update keys, pass undefined first: pb.me.settings(undefined, { signal }).

The read response also contains definitions, the server's current setting schema. Use it to find supported keys, defaults, allowed values, and which settings are user-modifiable. Unsupported keys are rejected. dark_mode and notifications_email are not current setting names. See Settings.

Howl like emoji

For custom images, use pb.me.emotes() and formatEmoteToken() to select a currently available Pack emote. See Pack custom emotes.

Set one emoji for members to use when liking your new howls:

await ..({ : '🔥' })

The default is 🔥. The server stores your choice on each new howl at creation; changing this setting leaves existing howls and their like counts unchanged.

Allow other members to edit howl tags

await ..({ : false })

allow_tag_edits_from_others is a boolean that defaults to true, including for existing accounts without a stored value. When on, other signed-in members can edit unprotected tags on all your existing and future howls. When off, ordinary tag editing is limited to you. Staff and content moderators retain their moderation permissions. Every edit requires a public explanation and appears in the howl's public tag history. Turning the setting off leaves earlier edits and history intact.

Friends

const { , ,  } = await ..()

for (const  of ) {
  .(., .)
}

A friend is a mutual follow. The server returns up to 100 of them in an object containing friends, count, and sometimes message.

Packs

const  = await ..()

This method returns each pack that the current user belongs to. The response includes membership data. The result is not limited to packs that the user owns.

Select a badge

await ..('founder-badge')

This method sends POST /user/me/badge with the store item ID of an owned badge. The server does not supply a related badge GET operation. The profile from pb.me() contains the active badge.

Storage usage

const  = await ..()

.(., ., ., .)
.(.., .., .[0]?.)

pb.me.storage() returns StorageUsage: totals against the account's allowanceBytes, a breakdown by kind, and the billable files, largest first. Howls are excluded. While the storage inventory is still being counted or is unavailable, the request fails with a PackbaseError of status 503 and code storage_inventory_unavailable; its body includes allowanceBytes and the inventory progress, so you can show a progress message and retry.

Bulk deletion and factory reset

Use pb.me.maintenance for server-owned review, timed typed confirmation, durable progress, retry, and completion acknowledgement. Both actions preserve login identity and moderation restrictions.

Muted and blocked members

Use pb.me.mutes and pb.me.blocks to list, add, or remove the current member's private outgoing relationships. Both use immutable profile IDs, preserve owner-only identity snapshots for removal, and accept request cancellation. See Blocking, muting, and visibility for the full contract and live-client cache handling.

On this page