Skip to main content

Following, muting, and blocking

Following, muting, and blocking are the basic social graph actions on Bluesky. Following subscribes you to someone's posts, while muting and blocking both let you limit your exposure to another user, in different ways: muting quietly hides someone's posts from your feeds, while blocking prevents interaction in both directions.

Following

Following a user is as easy as calling the follow action with the DID of the user you want to follow.

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

const { uri } = await client.call(follow, { did })
ParameterTypeDescriptionRequired
didstringThe DID of the user to followYes

Unfollowing

Unfollowing a user involves deleting the follow record via its URI, returned when you created the follow. This is very similar to what we did when unliking a post.

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

await client.call(deleteFollow, uri)
ParameterTypeDescriptionRequired
uristringThe URI of the follow record to deleteYes

Muting

Muting a user hides their posts from your feeds. Mutes are private — like Bookmarks, they are stored in the Bluesky App, rather than in your PDS. Muting a user is as easy as liking a post or following a user.

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

await client.call(muteActor, { actor: did })
ParameterTypeDescriptionRequired
didstringThe DID of the user to muteYes

Unmuting a user

Easy peasy:

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

await client.call(unmuteActor, { actor: did })
ParameterTypeDescriptionRequired
didstringThe DID of the user to un-muteYes

Blocking

Blocking a user prevents interaction and hides the user from the client experience. Blocked accounts will not be able to like, reply, mention, or follow you. Their posts, replies, and profile in search will also be hidden from you. Blocks are public.

Blocking users is as simple as muting, but requires creating a record directly.

client.create
import { currentDatetimeString } from '@atproto/lex'
import { app } from '@bsky/sdk/lexicons'

const { uri } = await client.create(app.bsky.graph.block, {
subject: blockingUserDid,
createdAt: currentDatetimeString(),
})

Creating a block takes two pieces of information. First, the repo the record is written to (the TypeScript client fills this in from your session):

ParameterTypeDescriptionRequired
repostringThe DID of the authenticated userYes

And the block record itself:

ParameterTypeDescriptionRequired
subjectstringThe DID of the user to blockYes
createdAtstringThe current timestampYes

Unblocking a user

Similar to likes and follows, unblocking a user is as simple as deleting the record.

client.delete
import { AtUri } from '@atproto/syntax'

const { rkey } = new AtUri(uri)

await client.delete(app.bsky.graph.block, { rkey })
ParameterTypeDescriptionRequired
repostringThe DID of the authenticated userYes
rkeystringThe record key (rkey) of the block recordYes

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