Guides

useSearchProfiles

useSearchProfiles is a React Hook used to query Lens profiles based on a query.

const { data, loading, hasMore, next } = useSearchProfiles(args)

Usage

import { useSearchProfiles } from "@lens-protocol/react-web"

function SearchProfiles() {
 const { data, loading } = useSearchProfiles({ query: 'web3'})

Reference

useSearchPublications(args)

Parameters

observerId: string (optional)

  • The id of the profile who is running the query, usually the logged in/active profile

limit: number (optional)

  • The amount of items to return

query: string (required)

  • The query that will be used to search profiles

Returns

{
  data: ProfileFragment[],
  loading: boolean,
  hasMore: boolean, // whether there are more profiles after the current batch
  next(): () => void, // fetches the next profiles and appends to the data
}