Hits per page not working

Hey. Am using jekyll-algolia to add search functionalities in my site. I have noticed when i change hitsPerPage its not working, stills displays 20 hits per page.
below is my code.

// Instanciating InstantSearch.js with Algolia credentials
const search = instantsearch({
  appId: 'TN80T3',
  indexName: 'zegetech.com',
  apiKey: '81daa33178cad0ab2dbe76b5dccb'
});

// Adding searchbar and results widgets
search.addWidget(
  instantsearch.widgets.searchBox({
    container: '#search-searchbar',
    placeholder: 'Search into posts...',
    poweredBy: true, // This is required if you're on the free Community plan
    showReset: true,
    searchAsYouType: true,
    autofucus: true
  })
);

const searchBar=document.getElementById('search-searchbar')



    search.addWidget(
      instantsearch.widgets.hits({
        hitsPerPage: 5,
        container: '#search-hits',
        templates:{
          empty: "Oops, No results found",
         item: '<a href="{{url}}"><b>{{{_highlightResult.title.value}}}</b> </a><br> {{slug}}</a>'
        }
      })
    );

    search.addWidget(
      instantsearch.widgets.pagination({
        container: '#pagination-container',
        maxPages: 10,
        // default is to scroll to 'body', here we disable this behavior
        scrollTo: false,
        showFirstLast: false,
      })
    );



// Starting the search
search.start();

Hi there,
hitsPerPage is a search parameter, you need to use the configure widget to enable it.
Here is how: https://www.algolia.com/doc/api-reference/widgets/configure/js/

@Youcef Thank for reply, i was able to resolve this, now am having a problem trying to add poweredBy widget. I get this error

TypeError: instantsearch.widgets.poweredBy is not a function

Here’s my code

 //poweredBy widget
    search.addWidget(
      instantsearch.widgets.poweredBy({
        container: '#powered_by',
        theme: 'dark'
      })
    );