Instantsearch.js: Expose `client` as prop on react-instantsearch

Created on 4 Nov 2016  路  4Comments  路  Source: algolia/instantsearch.js

Hi folks,

It would be great to be able to access the underlying Algolia client JS instance as a prop or be able to pass a clientProps prop to the root <InstantSearch> component; my need is to be able to pass custom options in this constructor:

https://github.com/algolia/algoliasearch-client-js/blob/master/src/AlgoliaSearchCore.js#L35

WDYT?

Question

All 4 comments

Yes I think we should right now extract this and only allow selecting the index on a main InstantSearch, this would also allow usage of different JavaScript client flavors like native.

So basically adding an algoliaClient prop and remove appId, apiKey. What do you think?

@vvo I already made some tests locally and managed to expose clientParameters, but having full control on the client flavour would be great, I can submit a PR if you're okay 馃憤

p.s. I'm not totally sure if we should remove appId and apiKey since most react instantsearch users will just want to use the default algoliasearch client without having to instantiate it.
I vote for keeping them + having an algoliaClient prop which overrides the default client. WDYT?

WDYT?

Works for me what you propose, shoot!

was merged

Was this page helpful?
0 / 5 - 0 ratings

Related issues

samouss picture samouss  路  3Comments

anthonyBertrant picture anthonyBertrant  路  3Comments

francoischalifour picture francoischalifour  路  3Comments

jvreeken picture jvreeken  路  3Comments

zackify picture zackify  路  4Comments