Skip to main content

index/classes/HealthService.md

Reads GET /health. Public: no Authorization header is sent.

Example​

const health = await new HealthService(httpClient).getHealth();
console.log(health.status, health.database?.status);

Extends​

  • BaseService

Constructors​

Constructor​

new HealthService(http, debugMode?, jwtAuth?): HealthService

Parameters​

ParameterType
httpHttpClient
debugMode?boolean
jwtAuth?JwtAuth

Returns​

HealthService

Inherited from​

BaseService.constructor

Methods​

getHealth()​

getHealth(): Promise<HealthCheckResponse>

The backend's health: overall status and the state of database, redis, mux, rabbitmq and the GalaChain query / launchpad-contract probes.

A critical dependency being down answers HTTP 503, which throws a NetworkError (statusCode 503, the backend's answer in body).

Returns​

Promise<HealthCheckResponse>

Throws​

NetworkError when the request fails or the body has no data

Since​

9.0.0


setJwtAuth()​

setJwtAuth(jwtAuth): void

Set the JWT authentication manager. Allows dynamic configuration of JWT auth after service creation.

Parameters​

ParameterTypeDescription
jwtAuthJwtAuthJWT auth manager instance

Returns​

void

Inherited from​

BaseService.setJwtAuth