How to use @algolia/requester-node-http - 1 common examples

To help you get started, we’ve selected a few @algolia/requester-node-http examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github algolia / algoliasearch-client-javascript / packages / algoliasearch / src / builds / node.ts View on Github external
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,

@algolia/requester-node-http

Promise-based request library for node using the native http module.

MIT
Latest version published 8 days ago

Package Health Score

85 / 100
Full package analysis

Popular @algolia/requester-node-http functions

Similar packages