Packbase SDK

pb.profiles

Fetch profiles, follow or unfollow users, and submit reports.

Call pb.profiles(username) with a Packbase username to get a lazy ProfileHandle. This action does not make a network request. Await the handle to fetch the profile. Alternatively, call an action such as .follow() directly. The action does not fetch the profile first.

Fetch a profile

const  = await .('rek')

.(.)
.(.?.)

The result is a Profile. Some properties are optional because public and authenticated requests can receive different data.

Follow and unfollow

Following and unfollowing are separate server operations:

await .('rek').()   // POST /user/:username/follow
await .('rek').() // DELETE /user/:username/follow

Both methods finish without response data (Promise<void>). If you follow an account that you already follow, the server returns status 400. The server returns the same status if you unfollow an account that you do not follow.

Report a user

const  = await .('rek').(
  .,
  'Repeated unsolicited posts.',
)

.(., .)

This sends POST /user/:username/report and returns a ReportResult.

On this page