MCPcopy Create free account
hub / github.com/GetStream/stream-js / flagUser

Method flagUser

src/client.ts:1091–1104  ·  view source on GitHub ↗

* Flag a user for moderation * @link https://getstream.io/activity-feeds/docs/node/moderation/?language=js#flagging-users * @method flagUser * @memberof StreamClient.prototype * @param {string} targetUserId - ID of the user to flag * @param {FlagUserOptions} [options] - Optional flagg

(targetUserId: string, options: FlagUserOptions = {})

Source from the content-addressed store, hash-verified

1089 * @example client.flagUser('bad-actor-456', { reason: 'inappropriate_content' })
1090 */
1091 flagUser(targetUserId: string, options: FlagUserOptions = {}) {
1092 this._throwMissingApiSecret();
1093
1094 return this.post<FlagAPIResponse>({
1095 url: 'moderation/flag',
1096 body: {
1097 entity_type: 'stream:user',
1098 entity_id: targetUserId,
1099 user_id: options.user_id,
1100 reason: options.reason,
1101 },
1102 token: this.getOrCreateToken(),
1103 });
1104 }
1105}

Callers 3

user_flag.jsFile · 0.80
client_test.jsFile · 0.80
flagMethod · 0.80

Calls 3

postMethod · 0.95
getOrCreateTokenMethod · 0.95

Tested by

no test coverage detected