|
| 1 | +<p align="center"> |
| 2 | + <a href="https://www.algolia.com"> |
| 3 | + <img alt="Algolia for JavaScript" src="https://raw.githubusercontent.com/algolia/algoliasearch-client-common/master/banners/javascript.png" > |
| 4 | + </a> |
| 5 | + |
| 6 | + <h4 align="center">The perfect starting point to integrate <a href="https://algolia.com" target="_blank">Algolia</a> within your JavaScript project</h4> |
| 7 | + |
| 8 | + <p align="center"> |
| 9 | + <a href="https://npmjs.org/package/@algolia/client-composition"><img src="https://img.shields.io/npm/v/@algolia/client-composition.svg?style=flat-square" alt="NPM version"></img></a> |
| 10 | + <a href="http://npm-stat.com/charts.html?package=@algolia/client-composition"><img src="https://img.shields.io/npm/dm/@algolia/client-composition.svg?style=flat-square" alt="NPM downloads"></a> |
| 11 | + <a href="https://www.jsdelivr.com/package/npm/@algolia/client-composition"><img src="https://data.jsdelivr.com/v1/package/npm/@algolia/client-composition/badge" alt="jsDelivr Downloads"></img></a> |
| 12 | + <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-green.svg?style=flat-square" alt="License"></a> |
| 13 | + </p> |
| 14 | +</p> |
| 15 | + |
| 16 | +<p align="center"> |
| 17 | + <a href="https://www.algolia.com/doc/libraries/javascript/" target="_blank">Documentation</a> • |
| 18 | + <a href="https://www.algolia.com/doc/guides/building-search-ui/what-is-instantsearch/js/" target="_blank">InstantSearch</a> • |
| 19 | + <a href="https://discourse.algolia.com" target="_blank">Community Forum</a> • |
| 20 | + <a href="http://stackoverflow.com/questions/tagged/algolia" target="_blank">Stack Overflow</a> • |
| 21 | + <a href="https://github.com/algolia/algoliasearch-client-javascript/issues" target="_blank">Report a bug</a> • |
| 22 | + <a href="https://www.algolia.com/doc/libraries/javascript/v5/" target="_blank">FAQ</a> • |
| 23 | + <a href="https://alg.li/support" target="_blank">Support</a> |
| 24 | +</p> |
| 25 | + |
| 26 | +## ✨ Features |
| 27 | + |
| 28 | +- Thin & **minimal low-level HTTP client** to interact with Algolia's API |
| 29 | +- Works both on the **browser** and **node.js** |
| 30 | +- **UMD and ESM compatible**, you can use it with any module loader |
| 31 | +- Built with TypeScript |
| 32 | + |
| 33 | +## 💡 Getting Started |
| 34 | + |
| 35 | +> [!TIP] |
| 36 | +> This API client is already a dependency of [the algoliasearch client](https://www.npmjs.com/package/algoliasearch), you don't need to manually install `@algolia/client-composition` if you already have `algoliasearch` installed. |
| 37 | +
|
| 38 | +To get started, you first need to install @algolia/client-composition (or any other available API client package). |
| 39 | +All of our clients comes with type definition, and are available for both browser and node environments. |
| 40 | + |
| 41 | +### With a package manager |
| 42 | + |
| 43 | +```bash |
| 44 | +yarn add @algolia/ [email protected] |
| 45 | +# or |
| 46 | +npm install @algolia/ [email protected] |
| 47 | +# or |
| 48 | +pnpm add @algolia/ [email protected] |
| 49 | +``` |
| 50 | + |
| 51 | +### Without a package manager |
| 52 | + |
| 53 | +Add the following JavaScript snippet to the <head> of your website: |
| 54 | + |
| 55 | +```html |
| 56 | +< script src= "https://cdn.jsdelivr.net/npm/@algolia/[email protected]/dist/builds/browser.umd.js"></ script> |
| 57 | +``` |
| 58 | + |
| 59 | +### Usage |
| 60 | + |
| 61 | +You can now import the Algolia API client in your project and play with it. |
| 62 | + |
| 63 | +```js |
| 64 | +import { compositionClient } from '@algolia/client-composition'; |
| 65 | + |
| 66 | +const client = compositionClient('YOUR_APP_ID', 'YOUR_API_KEY'); |
| 67 | +``` |
| 68 | + |
| 69 | +For full documentation, visit the **[Algolia JavaScript API Client](https://www.algolia.com/doc/libraries/javascript/v5/methods/composition/)**. |
| 70 | + |
| 71 | +## ❓ Troubleshooting |
| 72 | + |
| 73 | +Encountering an issue? Before reaching out to support, we recommend heading to our [FAQ](https://www.algolia.com/doc/libraries/javascript/v5/) 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) |
| 74 | + |
| 75 | +## 📄 License |
| 76 | + |
| 77 | +The Algolia JavaScript API Client is an open-sourced software licensed under the [MIT license](LICENSE). |
0 commit comments