typesense / typesense-instantsearch-adapter

A JS adapter library to build rich search interfaces with Typesense and InstantSearch.js
MIT License
361 stars 62 forks source link

Does the Typesense Adapter support extra header parameters? #182

Closed mbombonato closed 10 months ago

mbombonato commented 10 months ago

Description

In my infrastructure, I need a mandatory internal api-key (and other headers) for all requests. Is there any way to add those extra headers in all requests to Typesense using this instantsearch adapter?

https://www.algolia.com/doc/api-client/getting-started/request-options/#add-http-headers-to-your-requests

mbombonato commented 10 months ago

Ok... after a while, I've found the additionalHeaders parameter


      apiKey: 'xyz',
      nodes: [
        {
          host: `my-host.com`,
          port: 433,
          protocol: 'https',
        },
      ],
      connectionTimeoutSeconds: 5,
      numRetries: 5,
      additionalHeaders: { 'my-api-key': 'xyz' },
    }