Packbase SDK

pb.howls

Fetch, create, delete, like, comment on, rehowl, and report howls.

Call pb.howls(id) with a howl UUID to get a lazy HowlHandle. Creating the handle does not send a request. Await the handle to fetch the howl. Action methods such as .like() send only their applicable request.

const  = await .('howl-id')
.(., ..)

Create a howl

const  = await ..({
  : 'pack-id',
  : 'Hello, world!',
  : ['art', 'rating_safe'],
})

Packbase creates howls in a background job. By default, the SDK starts the job and checks its status. The promise resolves with the completed Howl. Application code requires only the await above.

HowlCreateInput accepts:

FieldTypeNotes
tenant_idstringPack UUID. The caller must be a member.
parent_idstring?Source howl UUID to quote. The quote survives source deletion; use .comment() for replies.
content_type'text'?The SDK supplies 'text' when omitted.
bodystring | nullPlain text or HTML. Use null only when assets are present.
asset_idsstring[]?Finalized upload IDs, up to 100.
tags[string, ...string[]]Must contain exactly one rating tag, in any position.

Pass { poll: false } to receive only { id } without a wait. Read Async Job Polling before you use this option. Your application must then monitor the incomplete job.

Upload assets

pb.howls.upload exposes init, append, finalize, and status. The SDK injects protocol commands and uses multipart FormData for appended blobs.

const  = await ...({ : ., : . })
if (typeof . !== 'string') throw new ('Missing upload ID')
const  = .
await ...({ , : 0, :  })
await ...()
await ...()

Upload responses are open JsonObject values until the server publishes stable response schemas.

Use an image or video MIME type for assetType. append() uses sequential, zero-based segment indexes. Finalization checks the declared byte count; IDs are bound to the current member and expire. A status result currently exposes state, file_percentage, check_after_secs, and an optional error. An upload ID is distinct from the future howl/job ID.

Delete

await .('howl-id').()

The signed-in user must have permission to delete a howl. The server does not currently supply a howl edit route.

There is no general body-edit method. Tags and media copyright have separate editing methods described below.

Likes

await .()
await .()

like() sends a bodyless PUT /howl/:id/like; unlike() sends a bodyless DELETE /howl/:id/like. Both are idempotent. A member has at most one like per howl. The author chooses the emoji in user settings; readers use the emoji already stored with the howl.

Every howl includes likes: { emoji, count, likedByMe }, even when the count is zero. The default emoji is 🔥. Set howl_like_emoji through pb.me.settings() to choose the emoji for new howls. Changing it leaves existing howls unchanged.

Comments and rehowls

const { : ,  } = await .('Good post.')
const { :  } = await .()
await .()

comment() returns HowlCommentResult: { id, likes }. Use this returned likes summary to reconcile optimistic replies with the server's emoji snapshot; local settings may be stale. Comments are sanitized by the server and limited to 1,024 characters. unrehowl() targets the original howl ID.

Report

const  = await .('howl-id').(
  .,
  'Source material is available here.',
)

The returned ReportResult contains the moderation ticket's id and status.

Public moderation summary

const  = await .('howl-id', { : 'feed' }).()
.(., .)

moderation() sends GET /howl/:id/moderation. The status is none, under_review, or reviewed. Public actions are warning, restriction, and content_removed. The same coarse data can appear as moderation_summary on a howl or comment. Reporter identities, case IDs, private notes, and investigation details are not included. Normal content visibility still applies.

Visibility context

pb.howls(id, { context: 'feed', signal }) retains feed mute filtering during detail hydration, including nested quote and reply previews. A direct read defaults to context: 'direct', preserving muted content intentionally opened through a profile or howl link. Blocking applies in both contexts and returns ordinary 404 responses for inaccessible reads and actions. See Blocking, muting, and visibility.

Only the original howl creator can change its media credit. Regular rehowls resolve to the original howl; quotes retain their own credit.

await pb.howls(id).setCopyright('© 2024 Artist name')
await pb.howls(id).setCopyright(null) // Restore the creator/year default

The credit applies to all media in the howl and is returned as howl.copyright. Text is trimmed and limited to 500 characters; blank text also restores the default. The endpoint is PUT /howl/:id/copyright with { copyright: string | null }.

Edit tags

Authors can edit their own howls. Other signed-in members can edit when the author's allow_tag_edits_from_others setting is on (the default). This setting applies to existing and future howls. Staff and content moderators retain their moderation permissions; being a pack host alone does not grant a bypass. Replies cannot be edited through this feature. Regular rehowls use the original howl's tags; quote howls retain their own tags.

Fetch current state before editing. fresh: true bypasses pending-read sharing and HTTP caches. Use the returned capabilities to decide which controls to show, and send the latest numeric revision with the edit:

const  = await .(, { : true })
if (. && . !== ) {
  const  = await .().({
    : ['rating_safe', 'digital_art'],
    : 'Added the medium used in this artwork.',
    : .,
  })
  .(., ., .)
}

setTags() sends PUT /howl/:id/tags and returns HowlTagEditResult: { tags, moderator_tags, tag_revision, edit }. Every edit requires a public explanation, including edits to your own howl. Explanations are trimmed and must contain 1–1,000 characters. Send the complete tag list, with at most 100 tags of at most 256 characters each and exactly one rating tag. Members can change the rating when it is not protected. Protected tags must remain unchanged unless the caller can manage tag locks.

Staff and content moderators can pass moderator_tags to replace the protected subset alongside the tags. In this endpoint, unlocking a tag leaves it in tags when it remains in the supplied tag list. A no-change request does not create an edit. A stale expected_revision returns 409 without changing tags or history: fetch fresh state, review the new diff, and submit again with the current revision. Other permission or visibility changes may also reject a save.

The existing moderatorTags({ tags, explanation, expected_revision }) method sends PUT /howl/:id/moderator-tags. It now requires the same explanation and revision and creates public history. Its legacy replacement semantics remove previously protected tags omitted from the new protected set; use setTags() to unlock a tag while keeping it on the howl.

Public tag history

const  = await .().()
for (const  of .) {
  .(.?., .)
  .(., .)
  .(., .)
}
if (. && .) {
  const  = await .().({ : . })
}

tagHistory() sends GET /howl/:id/tag-history, reads fresh on every call, and accepts signal for cancellation. History is public wherever the howl is visible and is ordered newest first. Each entry contains a string ID, numeric revision, timestamp, editor's public identity (or null when unavailable), explanation, and tag and lock diffs. History begins when tracking is deployed; creation does not count as an edit. The history follows the howl's normal access and deletion rules.

On this page