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

776 B

Home > kibana-plugin-server > ElasticsearchServiceSetup > createClient

ElasticsearchServiceSetup.createClient property

Create application specific Elasticsearch cluster API client with customized config.

Signature:

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

Example

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