Guides

Hide managed profiles

This functionality allows for the hiding and unhiding of managed profiles, providing users with greater control over their digital presence.

The context here is that anyone can assign any EVM address as a manager to their profile, and while this is expected to be used benevolently, due to the permissionless nature of Lens, there could be cases where a profile was set as manager inadvertently / or maliciously. In such cases, users could find unexpected profiles in their managed profiles list.

In order to provide a better user experience, we now support hiding (and unhiding) profiles from your managed profiles list, this has only a visual impact on your user experience.

🚧

Endpoints below require authentication as a Profile or as a Wallet

Hide a managed profile

To hide a managed profile, effectively omitting it from returning in the profilesManaged endpoint by default, use the following query. This only marks the profile as hidden, without affecting any on-chain data.

mutation HideManagedProfile {  
  hideManagedProfile(request: {profileId: "PROFILE_ID_HERE"})
}

Unhide a managed profile

Conversely, to restore a previously hidden profile to visible status, use the unhideManagedProfile mutation. This action makes the profile visible again by default when querying the profilesManaged endpoint.

mutation UnhideManagedProfile {  
  unhideManagedProfile(request: {profileId: "PROFILE_ID_HERE"})
}

Replace "PROFILE_ID_HERE" with the actual ID of the profile you wish to hide or unhide. In both cases, calling the mutation with a profile that is not managed by the user will throw an error, any valid input will return a void response.

Querying hidden managed profiles

To complete the user experience with this feature, the profilesManaged endpoint now contains a new optional flag on its request object called hiddenFilter which is an enum that can take the following values: ALL, HIDDEN_ONLY, NONE_HIDDEN. The default value is NONE_HIDDEN which will return the visible profiles, and with the use of the other 2 flags, you can complete freedom to create the user experience that fits your application best.

query ProfilesManaged {
  profilesManaged(request: {
    for: "0x1111...11111", # the profile manager address
    includeOwned: false,
    hiddenFilter: "HIDDEN_ONLY" # this value affects the returned results, defaults to NONE_HIDDEN if omitted
  }) {
    items {
      id
    }
    pageInfo {
      next
    }
  }
}