Overview
REST API
WebSocket RPC Server
JavaScript Code Examples
Getting All Friends
import { createRpcClient, createWebSocketsTransport } from '@dcl/rpc/dist/client';
import { FriendshipsServiceDefinition } from './protobuff-types/decentraland/social/friendships/friendships.gen';
const socialClientRpcUrl = 'wss://social.decentraland.org'; // Replace with the actual URL
const webSocketsTransport = createWebSocketsTransport(socialClientRpcUrl);
const service = loadService(FriendshipsServiceDefinition, webSocketsTransport);
const response = service.getFriends(Payload.create({ synapseToken }));
for await (const friends of response) {
processErrors(friends);
const userList = friends.users?.users ?? [];
// Process the list of friends
}Getting Mutual Friends
Last updated