Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export default function algoliasearch(appId: string, apiKey: string): SearchClient {
const clientOptions = {
appId,
apiKey,
timeouts: {
connect: 2,
read: 5,
write: 30,
},
requester: createNodeHttpRequester(),
logger: createNullLogger(),
responsesCache: createNullCache(),
requestsCache: createNullCache(),
hostsCache: createInMemoryCache(),
userAgent: createUserAgent(version).add({
segment: 'Node.js',
version: process.versions.node,
}),
};
return createSearchClient({
...clientOptions,
methods: {
search: multipleQueries,
searchForFacetValues: multipleSearchForFacetValues,
multipleBatch,
multipleGetObjects,