# elasticsearch-watcher-js **Repository Path**: mirrors_elastic/elasticsearch-watcher-js ## Basic Information - **Project Name**: elasticsearch-watcher-js - **Description**: Elasticsearch Watcher plugin for the elasticsearch.js client - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-08-08 - **Last Updated**: 2025-09-20 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Deprecated *April 18, 2017* The watcher plugin has been replaced with X-Pack for some time and while there is no official X-Pack plugin for [elasticsearch.js](https://github.com/elastic/elasticsearch-js) we will not be working on the elasticsearch-watcher module any more. For people trying to integrate with X-Pack via the client, consider using the [`client.transport.request()` method](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/transport-reference.html#_request_params_callback) to specify the properties of the request you are trying to make. --- # elasticsearch-watcher Watcher API plugin for the [elasticsearch.js](https://github.com/elastic/elasticsearch-js) client. ## Install elasticsearch-watcher is available on NPM: ``` npm install elasticsearch elasticsearch-watcher ``` bower: ``` bower install elasticsearch elasticsearch-watcher ``` Or by simply downloading [elasticsearch-watcher.js](elasticsearch-watcher.js) and including it in your project. **NOTE:** The elasticsearch-watcher.js file uses a UMD wrapper to greater compatibility and exports a global `ElasticsearchWatcher` variable when neither AMD or Common.js module systems are detected. ## Usage The elasticsearch-watcher API is a plugin for the [elasticsearch.js](https://github.com/elastic/elasticsearch-js) client. To mix it into an instance of `Client` we pass the entire module like so: ``` var elasticsearch = require('elasticsearch'); var elasticsearchWatcher = require('elasticsearch-watcher'); var client = new elasticsearch.Client({ plugins: [ elasticsearchWatcher ] }); ``` Doing this will add the `client.watcher` api to the client instance: ``` client.watcher.getWatch({ id: 42 }) .then(function (resp) { ... }); ``` ## API Documentation for the watcher api is available at [elastic/elasticsearch-watcher-js/docs/api.asciidoc](https://github.com/elastic/elasticsearch-watcher-js/blob/master/docs/api.asciidoc) for the time being. ## License Copyright 2015 Elasticsearch Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.