Hooks
useRefractProfile
Hook to access the current user’s Refract social profile information.
useRefractProfile()
While standard hooks like useAccount
(from wagmi) provide the user’s wallet address, useRefractProfile
gives you access to the rich social profile data managed by Refract Network. This is essential for creating personalized experiences and leveraging the social features of your dApp.
This hook returns the profile of the currently connected user, including their unique Refract ID and any linked social media information.
Usage
Return Value
The hook returns an object with the following properties:
RefractProfile
Object
The profile
object contains the following fields:
Field | Type | Description |
---|---|---|
userId | string | The unique, stable identifier for the user across the Refract Network. |
displayName | string | The user’s display name, typically from their primary social profile. |
profilePhotoUrl | string | A URL for the user’s avatar. |
username | string | The user’s handle (e.g., from TikTok or Telegram), if available. |
bio | string | The user’s bio from their social profile, if available. |
linkedSocials | object | An object containing platform-specific IDs, like tiktokId or telegramId . |
… | ::TODO: Add other relevant fields from the data model. |