メインコンテンツまでスキップ

Liking and reposting

Liking and reposting posts are core Bluesky actions. A like or repost is itself a record in the user's repository — many SDKs provide dedicated helpers for creating and removing them.

Liking a post

Liking a post requires the post's URI and its CID.

The URI indicates the repository DID, collection, and record key. The CID is the hash of the record itself.

like
  import { like } from '@bsky/sdk'

const { uri: likeUri } = await client.call(like, { uri, cid })
ParameterTypeDescriptionRequired
uristringThe URI of the postYes
cidstringThe CID of the postYes

Unliking a post

Unliking a post requires only the post's URI, which refers to its record. In the case of a Like, unliking the post means deleting the Like record.

deleteLike
  import { deleteLike } from '@bsky/sdk'

await client.call(deleteLike, likeUri)
ParameterTypeDescriptionRequired
uristringThe URI of the like record to deleteYes

Reposting a post

Reposting and un-reposting looks almost exactly the same as liking and unliking.

repost
  import { repost } from '@bsky/sdk'

const { uri: repostUri } = await client.call(repost, { uri, cid })
ParameterTypeDescriptionRequired
uristringThe URI of the postYes
cidstringThe CID of the postYes

Un-reposting a post

Same as unlike, un-reposting a post requires only the post's URI, whose record we want to delete.

deleteRepost
  import { deleteRepost } from '@bsky/sdk'

await client.call(deleteRepost, repostUri)
ParameterTypeDescriptionRequired
uristringThe URI of the repost record to deleteYes

Quote reposting

備考

For information on quote posts, see the Create a post tutorial.


Looking for more? Browse additional tutorials and guides on atproto.com.