JSPM

algoliasearch

4.24.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2391715
  • Score
    100M100P100Q187755F
  • License MIT

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

Package Exports

  • algoliasearch
  • algoliasearch/dist/algoliasearch-lite.esm.browser
  • algoliasearch/dist/algoliasearch-lite.esm.browser.js
  • algoliasearch/dist/algoliasearch-lite.umd.js
  • algoliasearch/dist/algoliasearch.esm.browser
  • algoliasearch/dist/algoliasearch.esm.browser.js
  • algoliasearch/dist/algoliasearch.umd.js
  • algoliasearch/index
  • algoliasearch/index.js
  • algoliasearch/lite
  • algoliasearch/lite.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (algoliasearch) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Algolia for JavaScript

The perfect starting point to integrate Algolia within your JavaScript project

NPM version NPM downloads jsDelivr Downloads License

DocumentationInstantSearchCommunity ForumStack OverflowReport a bugSupport

✨ Features

  • Thin & minimal low-level HTTP client to interact with Algolia's API
  • Works both on the browser and node.js
  • UMD compatible, you can use it with any module loader
  • Built with TypeScript

💡 Getting Started

First, install Algolia JavaScript API Client via the npm package manager:

npm install algoliasearch

Then, create objects on your index:

const algoliasearch = require("algoliasearch");

const client = algoliasearch("YourApplicationID", "YourAdminAPIKey");
const index = client.initIndex("your_index_name");

const objects = [
  {
    objectID: 1,
    name: "Foo"
  }
];

index
  .saveObjects(objects)
  .then(({ objectIDs }) => {
    console.log(objectIDs);
  })
  .catch(err => {
    console.log(err);
  });

Finally, let's actually search using the search method:

index
  .search("Fo")
  .then(({ hits }) => {
    console.log(hits);
  })
  .catch(err => {
    console.log(err);
  });

For full documentation, visit the online documentation.

📄 License

Algolia JavaScript API Client is an open-sourced software licensed under the MIT license.