How to achieve hierarchical facets without using swift dependencies

am following below example to develop with React App search UI.

I want to call search Api when user click on 1st level category to get the 2nd level categories but the Api connector doesn't have a method to call search. Like below code:

var client = SwiftypeAppSearch.createClient({

  hostIdentifier: "host-n16af4",

  searchKey: "search-foueoyusuprj187kv7hyfof9",

  engineName: "hierarchichal-facets"

getCategory1Facets = async () => {

    const results = await, {

      page: {

        size: 0


      facets: {

        category1: [


            type: "value"







But i dont have search method on the connector am using. below is sample code.
How to achieve that without swift connector ?

const connector = new AppSearchAPIConnector({
  searchKey: "search-371auk61r2bwqtdzocdgutmg",
  engineName: "search-ui-examples",
  hostIdentifier: "host-2376rb",
  beforeSearchCall: (existingSearchOptions, next) =>
      group: { field: "title" }