Packages
Search Drops

Search Drops

There are two ways that drops can be searched, by exact word in name or fuzzy search in name and description.

Exact word search

When searching for a whole word, use fetch method:

import { Drop } from '@poap-xyz/drops';
import { PaginatedResult } from '@poap-xyz/utils';
 
const paginatedDrops: PaginatedResult<Drop> = await dropsClient.fetch({
  sortField: DropsSortFields.Name,
  sortDir: Order.ASC,
  limit: 3,
  offset: 0,
  name: 'POAP',
});

Fuzzy search

When given a generic search input, and to match any part of the words used in the name of the description, use search method:

import { Drop } from '@poap-xyz/drops';
import { PaginatedResult } from '@poap-xyz/utils';
 
const paginatedDrops: PaginatedResult<Drop> = await dropsClient.search({
  limit: 3,
  offset: 0,
  search: 'POAP',
});