kibana/docs/development/core/server/kibana-plugin-server.elasticsearchservicesetup.createclient.md

848 B

Home > kibana-plugin-server > ElasticsearchServiceSetup > createClient

ElasticsearchServiceSetup.createClient property

Create application specific Elasticsearch cluster API client with customized config. See IClusterClient.

Signature:

readonly createClient: (type: string, clientConfig?: Partial<ElasticsearchClientConfig>) => IClusterClient;

Example

const client = elasticsearch.createCluster('my-app-name', config);
const data = await client.callAsInternalUser();