Get Friends

Friends

📘

Permission Required

This feature requires the Friends permission.

Return a list of the user's friends and their public profiles.

const {HandCashConnect} = require('@handcash/handcash-connect');
const handCashConnect = new HandCashConnect({ 
   appId: '<app-id>', 
   appSecret: '<secret>',
}); 

const account = handCashConnect.getAccountFromAuthToken(token);
const friends = await account.profile.getFriends();

console.log(friends);
// friends
[
  {
    id: '5fa2d0ebab7c740c9e7b3ecb',
    handle: 'nosetwo',
    paymail: '[email protected]',
    displayName: 'Nose two',
    avatarUrl: 'https://res.cloudinary.com/hk7jbd3jh/image/upload/v1574787300/gntqxv6ed7sacwpfwumj.jpg',
    localCurrencyCode: 'EUR'
  },
  {
    id: '5f64dfbd7549610022d2861b',
    handle: 'rjseibane',
    paymail: '[email protected]',
    displayName: 'Rafa JS',
    avatarUrl: 'https://res.cloudinary.com/hk7jbd3jh/image/upload/v1584356800/hprcfwdasenpnrqei3uz.jpg',
    localCurrencyCode: 'USD'
  }
]

Did this page help you?