You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
xuma 061bf09bc8 one key push update 2 years ago
..
dist one key push update 2 years ago
plugins one key push update 2 years ago
src one key push update 2 years ago
CHANGELOG.md one key push update 2 years ago
LICENSE.txt one key push update 2 years ago
README.md one key push update 2 years ago
bower.json one key push update 2 years ago
index.js one key push update 2 years ago
lite.js one key push update 2 years ago
package.json one key push update 2 years ago
reactnative.js one key push update 2 years ago

README.md

Algolia for JavaScript

The perfect starting point to integrate Algolia within your JavaScript project

Build Status 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
  • Contains type definitions: @types/algoliasearch

💡 Getting Started

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

npm install --save 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.