Skip to contents

Delete a record in a repo

Usage

bs_delete_record(
  collection,
  rkey,
  user = get_bluesky_user(),
  pass = get_bluesky_pass(),
  auth = bs_auth(user, pass)
)

Arguments

collection

Character, length 1. The NSID of the record collection.

rkey

Character, length 1. The CID of the version of the record. If not specified, then return the most recent version.

user

Character. User name to log in with. Defaults to get_bluesky_user().

pass

Character. App password to log in with. Defaults to get_bluesky_pass().

auth

Authentication information. Defaults to bs_auth(user, pass).

Value

an httr2 status code

Function introduced

v0.1.0 (2023-11-25)

Examples

if (FALSE) { # has_bluesky_pass() & has_bluesky_user()
# get info about a record
post_rcd <- bs_get_record('https://bsky.app/profile/bskyr.bsky.social/post/3kf2577exva2x')
# create a record, to like the post
like <- list(
  subject = list(
    uri = post_rcd$uri,
    cid = post_rcd$cid
  ),
  createdAt = bs_created_at()
)

rec <- bs_create_record(collection = 'app.bsky.feed.like', record = like)
bs_delete_record(
  collection = 'app.bsky.feed.like',
  rkey = bs_extract_record_key(rec$uri)
)
}