https://github.com/opensearch-project/opensearch-js
Node.js Client for OpenSearch
https://github.com/opensearch-project/opensearch-js
Last synced: about 2 months ago
JSON representation
Node.js Client for OpenSearch
- Host: GitHub
- URL: https://github.com/opensearch-project/opensearch-js
- Owner: opensearch-project
- License: apache-2.0
- Created: 2021-07-23T17:42:26.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2025-04-20T00:11:09.000Z (2 months ago)
- Last Synced: 2025-04-25T23:15:49.689Z (2 months ago)
- Language: JavaScript
- Homepage: https://opensearch.org/docs/latest/clients/javascript/
- Size: 27.3 MB
- Stars: 207
- Watchers: 20
- Forks: 127
- Open Issues: 47
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.txt
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
- Security: SECURITY.md
Awesome Lists containing this project
README
[](https://github.com/opensearch-project/opensearch-js/actions/workflows/nodejs.yml)
[](https://github.com/opensearch-project/opensearch-js/actions/workflows/integration.yml)
[](https://github.com/opensearch-project/opensearch-js/actions/workflows/bundler.yml)
[](https://codecov.io/gh/opensearch-project/opensearch-js)
[](https://discuss.opendistrocommunity.dev/c/clients/)

OpenSearch Node.js client
- [Welcome!](#welcome)
- [Example use](#example-use)
- [Setup](#setup)
- [Sample code](#sample-code)
- [Project Resources](#project-resources)
- [Code of Conduct](#code-of-conduct)
- [License](#license)
- [Copyright](#copyright)## Welcome!
**[opensearch-js](https://www.npmjs.com/package/@opensearch-project/opensearch)** is [a community-driven, open source fork](https://aws.amazon.com/blogs/opensource/introducing-opensearch/) of elasticsearch-js licensed under the [Apache v2.0 License](LICENSE.txt). For more information, see [opensearch.org](https://opensearch.org/).
## Example use
The OpenSearch JavaScript client provides a safer and easier way to interact with your OpenSearch cluster. Rather than using OpenSearch from the browser and potentially exposing your data to the public, you can build an OpenSearch client that takes care of sending requests to your cluster.
The client contains a library of APIs that let you perform different operations on your cluster and return a standard response body. The example here demonstrates some basic operations like creating an index, adding documents, and searching your data.
### Setup
To add the client to your project, install it with npm:
```bash
npm i @opensearch-project/opensearch
```If you prefer to add the client manually or just want to examine the source code, see [opensearch-js](https://github.com/opensearch-project/opensearch-js) on GitHub.
Then require the client:
```javascript
const { Client } = require('@opensearch-project/opensearch');
```## Sample code
Please see the [USER_GUIDE](USER_GUIDE.md) for code snippets.
## Project Resources
- [Project Website](https://opensearch.org/)
- [Downloads](https://opensearch.org/downloads.html).
- [Documentation](https://opensearch.org/docs/)
- Need help? Try [Forums](https://discuss.opendistrocommunity.dev/)
- [Project Principles](https://opensearch.org/#principles)
- [Contributing to OpenSearch](CONTRIBUTING.md)
- [Maintainer Responsibilities](MAINTAINERS.md)
- [Release Management](RELEASING.md)
- [Admin Responsibilities](ADMINS.md)
- [Security](SECURITY.md)
- [NPM Page](https://www.npmjs.com/package/@opensearch-project/opensearch)## Code of Conduct
This project has adopted the [Amazon Open Source Code of Conduct](CODE_OF_CONDUCT.md). For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq), or contact [[email protected]](mailto:[email protected]) with any additional questions or comments.
## License
This project is licensed under the [Apache v2.0 License](LICENSE.txt).
## Copyright
Copyright OpenSearch Contributors. See [NOTICE](NOTICE.txt) for details.