JavaScript SDK — Friends

Friends — mp.friends

list
await mp.friends.list(playerToken)

Returns the player's friend list with presence.

lookup
await mp.friends.lookup(playerToken, playerTag)

Finds a player by Name#tag — the string shown at registration.

request
await mp.friends.request(playerToken, { playerTag?, playerId? })

Sends a friend request by tag or id.

accept / decline / remove
await mp.friends.accept(playerToken, playerId)
await mp.friends.decline(playerToken, playerId)
await mp.friends.remove(playerToken, playerId)

Answer incoming requests and manage the list.

steam
await mp.friends.steam(playerToken, steamIds)

Imports Steam friends — array of SteamID64 strings; matches players who registered with Steam.

invite / invites
await mp.friends.invite(playerToken, playerId)
await mp.friends.invites(playerToken)

Sends a game/room invite; lists pending invites.

acceptInvite / declineInvite
await mp.friends.acceptInvite(playerToken, inviteId)
await mp.friends.declineInvite(playerToken, inviteId)

Answers an invite by its invite_id.