Alokai

findItemsByWidget

Searches for items by widget. Please note that this request requires tenant config of the bloomreach to have auth key set so that you don't have to provide auth key in the query hint.

This method sends a GET request to the search endpoint of the Vue Storefront API Middleware. In turn, it receives data from the Bloomreach GraphQL Commerce API using findItemsByWidget query.

Signature

declare function findItemsByWidget(
	params: QueryParams<QueryFindItemsByWidgetArgs>
): Promise<ItemsPageResult>;

Parameters

NameRequiredTypeDescription
paramsRequiredQueryParams<QueryFindItemsByWidgetArgs>Check the type to check specific parameters

Returns

List of matching items

Referenced Types

Examples

Find items by widget.

const results = await sdk.brd.findItemsByWidget({
  text: 'bolts',
  queryHint: {
    widgetId: 'r926zmjv',
    widgetType: 'keyword',
    brUid2: 'some bruid2'
  }
});
results.items // found items

Find items by widget and pick which fields to return manually

const results = sdk.brd.findItemsByWidget({
  text: 'bolts',
  queryHint: {
    widgetId: 'r926zmjv',
    widgetType: 'keyword',
    brUid2: 'some bruid2'
  },
  expect: `
    items {
      displayName
      slug
    }
  `
 });
 results.items // found items

On this page