🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more

algoliasearch

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
a

algoliasearch

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

5.25.0
latest
99

Supply Chain Security

100

Vulnerability

96

Quality

99

Maintenance

100

License

Version published
Weekly downloads
2.1M
0.91%
Maintainers
10
Weekly downloads
 
Created
Issues
20

What is algoliasearch?

The algoliasearch npm package is a JavaScript client for Algolia, a hosted search API that provides a fast and accurate search experience for websites and mobile applications. The package allows developers to integrate Algolia's search capabilities into their JavaScript applications, enabling features such as full-text search, faceting, filtering, and geolocation queries.

What are algoliasearch's main functionalities?

Search

Perform a search query on an Algolia index and retrieve the results.

const algoliasearch = require('algoliasearch');
const client = algoliasearch('YourApplicationID', 'YourAdminAPIKey');
const index = client.initIndex('your_index_name');
index.search('query string').then(({ hits }) => {
  console.log(hits);
});

Indexing

Add or update a record in an Algolia index.

const algoliasearch = require('algoliasearch');
const client = algoliasearch('YourApplicationID', 'YourAdminAPIKey');
const index = client.initIndex('your_index_name');
index.saveObject({ objectID: '1', name: 'Foo' }).then(() => {
  console.log('Object indexed');
});

Configure Index Settings

Configure settings of an Algolia index to define ranking, attributes for faceting, etc.

const algoliasearch = require('algoliasearch');
const client = algoliasearch('YourApplicationID', 'YourAdminAPIKey');
const index = client.initIndex('your_index_name');
index.setSettings({
  searchableAttributes: ['name', 'description'],
  customRanking: ['desc(popularity)']
}).then(() => {
  console.log('Settings updated');
});

Manage Indices

List all indices in your Algolia application and manage them.

const algoliasearch = require('algoliasearch');
const client = algoliasearch('YourApplicationID', 'YourAdminAPIKey');
client.listIndices().then(({ items }) => {
  console.log(items);
});

Other packages similar to algoliasearch

FAQs

Package last updated on 12 May 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts