@avvyr/storefront-sdk - v0.19.0
    Preparing search index...

    Interface ProductSearchParams

    interface ProductSearchParams {
        attributes?: string;
        campaignCode?: string;
        categoryHandle?: string;
        categoryId?: string;
        hasCampaign?: boolean;
        inStock?: boolean;
        isDiscounted?: boolean;
        limit?: number;
        page?: number;
        q?: string;
        query?: string;
        sort?: string;
        variants?: number;
        [key: string]: string | number | boolean | undefined;
    }

    Indexable

    • [key: string]: string | number | boolean | undefined

      Filter attributes as key=value pairs (e.g. f.color=red)

    Index
    attributes?: string

    Which attributes to return in each product's attributes[].

    (omitted) none — the default on every LIST endpoint "all" all of them "code1,code2" only those codes

    Lists ship no attributes unless asked. The array runs to several kilobytes per product on a catalogue with dozens of attributes each, and most callers render none of it. Name the codes your card actually displays; the response is narrowed server-side.

    Single-product endpoints (ProductsResource.getBySku, getByHandle, getVariantGroup) ignore this and always return everything — answering that is their whole purpose.

    campaignCode?: string
    categoryHandle?: string

    Category handle. Preferred over categoryId on a category page — the API resolves it server-side in parallel with the rest of the query, so the caller does not need a separate lookup first.

    categoryId?: string

    Category id. Note the singular: the API does not read a categories param.

    hasCampaign?: boolean
    inStock?: boolean
    isDiscounted?: boolean
    limit?: number
    page?: number
    q?: string

    Use query — kept as an alias for backward compatibility

    query?: string

    Free-text search query

    sort?: string
    variants?: number

    How many sibling variants to return per product, as product.variants.

    (omitted) or 0 none — the default 4 up to four, cheapest first

    10 clamped to 10 server-side

    Opt-in because siblings are the heaviest thing a list carries after attributes. The scalar variantCount is always present, so a "+12 more" badge needs no siblings at all — ask for these only when you render a swatch row.