2024-01-05 12:14:38 +00:00
< p align = "center" >
< a href = "https://www.algolia.com" >
< img alt = "Algolia for JavaScript" src = "https://raw.githubusercontent.com/algolia/algoliasearch-client-common/master/banners/javascript.png" >
< / a >
< h4 align = "center" > The perfect starting point to integrate < a href = "https://algolia.com" target = "_blank" > Algolia< / a > within your JavaScript project< / h4 >
< p align = "center" >
2026-02-11 16:20:26 +00:00
< a href = "https://npmjs.com/package/algoliasearch" > < img src = "https://img.shields.io/npm/v/algoliasearch.svg?style=flat-square" alt = "NPM version" > < / img > < / a >
2024-01-05 12:14:38 +00:00
< a href = "http://npm-stat.com/charts.html?package=algoliasearch" > < img src = "https://img.shields.io/npm/dm/algoliasearch.svg?style=flat-square" alt = "NPM downloads" > < / a >
< a href = "https://www.jsdelivr.com/package/npm/algoliasearch" > < img src = "https://data.jsdelivr.com/v1/package/npm/algoliasearch/badge" alt = "jsDelivr Downloads" > < / img > < / a >
2026-02-11 16:20:26 +00:00
< a href = "LICENSE" > < img src = "https://img.shields.io/badge/license-MIT-green.svg?style=flat-square" alt = "License" > < / a >
2024-01-05 12:14:38 +00:00
< / p >
< / p >
< p align = "center" >
2026-02-11 16:20:26 +00:00
< a href = "https://www.algolia.com/doc/libraries/sdk/install#javascript" target = "_blank" > Documentation< / a > •
2024-01-05 12:14:38 +00:00
< a href = "https://www.algolia.com/doc/guides/building-search-ui/what-is-instantsearch/js/" target = "_blank" > InstantSearch< / a > •
< a href = "https://discourse.algolia.com" target = "_blank" > Community Forum< / a > •
< a href = "http://stackoverflow.com/questions/tagged/algolia" target = "_blank" > Stack Overflow< / a > •
< a href = "https://github.com/algolia/algoliasearch-client-javascript/issues" target = "_blank" > Report a bug< / a > •
2026-02-11 16:20:26 +00:00
< a href = "https://alg.li/support" target = "_blank" > Support< / a >
2024-01-05 12:14:38 +00:00
< / p >
## ✨ Features
- Thin & **minimal low-level HTTP client** to interact with Algolia's API
- Works both on the **browser** and **node.js**
2026-02-11 16:20:26 +00:00
- **UMD and ESM compatible**, you can use it with any module loader
2024-01-05 12:14:38 +00:00
- Built with TypeScript
## 💡 Getting Started
2026-02-11 16:20:26 +00:00
To get started, you first need to install algoliasearch (or any other available API client package).
All of our clients comes with type definition, and are available for both browser and node environments.
### With a package manager
2024-01-05 12:14:38 +00:00
```bash
2026-02-13 07:35:14 +00:00
yarn add algoliasearch@5.48.1
2026-02-11 16:20:26 +00:00
# or
2026-02-13 07:35:14 +00:00
npm install algoliasearch@5.48.1
2026-02-11 16:20:26 +00:00
# or
2026-02-13 07:35:14 +00:00
pnpm add algoliasearch@5.48.1
2024-01-05 12:14:38 +00:00
```
2026-02-11 16:20:26 +00:00
### Without a package manager
2024-01-05 12:14:38 +00:00
2026-02-11 16:20:26 +00:00
Add the following JavaScript snippet to the < head > of your website:
```html
// for the full client
2026-02-13 07:35:14 +00:00
< script src = "https://cdn.jsdelivr.net/npm/algoliasearch@5.48.1/dist/algoliasearch.umd.js" > < / script >
2026-02-11 16:20:26 +00:00
// for the lite client
2026-02-13 07:35:14 +00:00
< script src = "https://cdn.jsdelivr.net/npm/algoliasearch@5.48.1/dist/lite/builds/browser.umd.js" > < / script >
2024-01-05 12:14:38 +00:00
```
2026-02-11 16:20:26 +00:00
### Usage
You can now import the Algolia API client in your project and play with it.
2024-01-05 12:14:38 +00:00
```js
2026-02-11 16:20:26 +00:00
import { algoliasearch } from 'algoliasearch';
const client = algoliasearch('YOUR_APP_ID', 'YOUR_API_KEY');
// or with the lite client
import { liteClient } from 'algoliasearch/lite';
const client = liteClient('YOUR_APP_ID', 'YOUR_API_KEY');
2024-01-05 12:14:38 +00:00
```
2026-02-11 16:20:26 +00:00
For full documentation, visit the ** [Algolia JavaScript API Client ](https://www.algolia.com/doc/libraries/sdk/methods/search/ )**.
## ❓ Troubleshooting
Encountering an issue? Before reaching out to support, we recommend heading to our [FAQ ](https://support.algolia.com/hc/en-us/sections/15061037630609-API-Client-FAQs ) where you will find answers for the most common issues and gotchas with the client. You can also open [a GitHub issue ](https://github.com/algolia/api-clients-automation/issues/new?assignees=&labels=&projects=&template=Bug_report.md )
2024-01-05 12:14:38 +00:00
## 📄 License
2026-02-11 16:20:26 +00:00
The Algolia JavaScript API Client is an open-sourced software licensed under the [MIT license ](LICENSE ).