Skip to main content
⚠️ Legacy SDK DocumentationThis documentation uses our older SDK (@handcash/handcash-connect), but the v3 SDK does not support this feature yet.

Friends

The Friends API allows you to retrieve a list of the user’s friends and their public profiles. This requires the FRIENDS permission.

Prerequisites

  • User must have authorized your app with the FRIENDS permission
  • User account must be initialized with an authentication token

Setup

Get Friends

Retrieves a list of the user’s friends and their public profiles.
Returns: A promise that resolves to an array of public profiles of the user’s friends. Example:

Response Type

Each friend in the array is a UserPublicProfile object with the following structure: Example Response:

Permissions

The getFriends() method requires the FRIENDS permission. Users must grant this permission when authorizing your app. To check if a user has granted the FRIENDS permission:

Error Handling

Use Cases

  • Display user’s friends list in your application
  • Show friend activity or status
  • Enable friend-to-friend features
  • Build social features around HandCash connections

Important Notes

  • The FRIENDS permission must be requested during the initial authorization flow
  • If a user hasn’t granted the FRIENDS permission, the method will throw an error
  • Friends data is read-only - you cannot add or remove friends through the API
  • The friends list reflects the user’s current HandCash friends