algoliasearch

  • Version 5.28.0
  • Published
  • 1.48 MB
  • 13 dependencies
  • MIT license

Install

npm i algoliasearch
yarn add algoliasearch
pnpm add algoliasearch

Overview

A fully-featured and blazing-fast JavaScript API client to interact with Algolia API.

Index

Functions

function algoliasearch

algoliasearch: (
appId: string,
apiKey: string,
options?: (ClientOptions & TransformationOptions) | undefined
) => Algoliasearch;

    Type Aliases

    type Algoliasearch

    type Algoliasearch = SearchClient & {
    initAbtesting: (
    initOptions: InitClientOptions & RegionOptions$1
    ) => AbtestingClient;
    initAnalytics: (
    initOptions: InitClientOptions & RegionOptions$2
    ) => AnalyticsClient;
    initIngestion: (
    initOptions: InitClientOptions & RegionOptions$3
    ) => IngestionClient;
    initInsights: (
    initOptions: InitClientOptions & RegionOptions$4
    ) => InsightsClient;
    initMonitoring: (initOptions?: InitClientOptions) => MonitoringClient;
    initPersonalization: (
    initOptions: InitClientOptions & RegionOptions$5
    ) => PersonalizationClient;
    initQuerySuggestions: (
    initOptions: InitClientOptions & RegionOptions$6
    ) => QuerySuggestionsClient;
    initRecommend: (initOptions?: InitClientOptions) => RecommendClient;
    /**
    * Helper: Similar to the `saveObjects` method but requires a Push connector (https://www.algolia.com/doc/guides/sending-and-managing-data/send-and-update-your-data/connectors/push/) to be created first, in order to transform records before indexing them to Algolia. The `region` must have been passed to the client instantiation method.
    *
    * @summary Save objects to an Algolia index by leveraging the Transformation pipeline setup using the Push connector (https://www.algolia.com/doc/guides/sending-and-managing-data/send-and-update-your-data/connectors/push/).
    * @param saveObjects - The `saveObjects` object.
    * @param saveObjects.indexName - The `indexName` to save `objects` in.
    * @param saveObjects.objects - The array of `objects` to store in the given Algolia `indexName`.
    * @param saveObjects.batchSize - The size of the chunk of `objects`. The number of `batch` calls will be equal to `length(objects) / batchSize`. Defaults to 1000.
    * @param saveObjects.waitForTasks - Whether or not we should wait until every `batch` tasks has been processed, this operation may slow the total execution time of this method but is more reliable.
    * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `batch` method and merged with the transporter requestOptions.
    */
    saveObjectsWithTransformation: (
    options: SaveObjectsOptions,
    requestOptions?: RequestOptions | undefined
    ) => Promise<WatchResponse>;
    /**
    * Helper: Similar to the `partialUpdateObjects` method but requires a Push connector (https://www.algolia.com/doc/guides/sending-and-managing-data/send-and-update-your-data/connectors/push/) to be created first, in order to transform records before indexing them to Algolia. The `region` must have been passed to the client instantiation method.
    *
    * @summary Save objects to an Algolia index by leveraging the Transformation pipeline setup in the Push connector (https://www.algolia.com/doc/guides/sending-and-managing-data/send-and-update-your-data/connectors/push/).
    * @param partialUpdateObjects - The `partialUpdateObjects` object.
    * @param partialUpdateObjects.indexName - The `indexName` to update `objects` in.
    * @param partialUpdateObjects.objects - The array of `objects` to update in the given Algolia `indexName`.
    * @param partialUpdateObjects.createIfNotExists - To be provided if non-existing objects are passed, otherwise, the call will fail..
    * @param partialUpdateObjects.batchSize - The size of the chunk of `objects`. The number of `batch` calls will be equal to `length(objects) / batchSize`. Defaults to 1000.
    * @param partialUpdateObjects.waitForTasks - Whether or not we should wait until every `batch` tasks has been processed, this operation may slow the total execution time of this method but is more reliable.
    * @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `getTask` method and merged with the transporter requestOptions.
    */
    partialUpdateObjectsWithTransformation: (
    options: PartialUpdateObjectsOptions,
    requestOptions?: RequestOptions | undefined
    ) => Promise<WatchResponse>;
    };

      type InitClientOptions

      type InitClientOptions = Partial<{
      /**
      * App to target with the initialized client, defaults to the `algoliasearch` appId.
      */
      appId: string;
      /**
      * API key of the targeted app ID, defaults to the `algoliasearch` apiKey.
      */
      apiKey: string;
      options: ClientOptions;
      }>;
      • Options forwarded to the client initialized via the init method.

      type Region

      type Region = Region$1 | Region$2 | Region$3 | Region$4 | Region$5 | Region$6;

        type RegionOptions

        type RegionOptions =
        | RegionOptions$1
        | RegionOptions$2
        | RegionOptions$3
        | RegionOptions$4
        | RegionOptions$5
        | RegionOptions$6;

          type TransformationOptions

          type TransformationOptions = {
          transformation?:
          | {
          region: Region$3;
          }
          | undefined;
          };

            Package Files (2)

            Dependencies (13)

            Dev Dependencies (11)

            Peer Dependencies (0)

            No peer dependencies.

            Badge

            To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

            You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/algoliasearch.

            • Markdown
              [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/algoliasearch)
            • HTML
              <a href="https://www.jsdocs.io/package/algoliasearch"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>