Modules
Collections
Search Collections

Search Collections

Search Collections matching a search term.

import { Collection, Order, PaginatedResult } from '@poap-xyz/poap-sdk';
 
const searchTerm = 'POAP';
 
const allCollections: Collection[] = [];
let cursor: number | null = 0;
 
while (cursor !== null) {
  const { items: collections, nextCursor }: PaginatedResult<Collection> = await client.search({
    offset: cursor,
    limit: 10,
    query: searchTerm,
  });
  allCollections.push(...collections);
  cursor = nextCursor;
}