Skip to main content

Overview

Returns a function that blocks a user by their ID. On a new block, the server retroactively removes any existing follows and connections between the two users (both directions). Blocking is idempotent — re-blocking an already-blocked user succeeds.
Requires the moderation bundle. See Moderation — Blocking.

Usage Example

Parameters

The hook returns a function. That function accepts:
string
required
The ID of the user to block (the target).

Returns

The returned function resolves to the block row, a BlockRow. Blocking a user the current user already blocks resolves to the existing row.
string
ID of the block record.
User
The blocked user. Public profile fields only. See User data model.
string
ISO timestamp of when the block was created.