Checks the health status of the CyborgDB microservice to verify connectivity and service availability.
async getHealth(): Promise<{ status: string; api_version: string; version: string }>

Returns

Promise<{ status: string; api_version: string; version: string }>: A Promise that resolves to the health status response from the CyborgDB service containing the service status, API version, and application version.

Exceptions

Example Usage

import { Client } from 'cyborgdb';

const client = new Client('http://localhost:8000', 'your-api-key');

try {
    const health = await client.getHealth();
    console.log('Service health status:', health);
    // Expected output: { status: 'healthy', api_version: 'v1', version: '1.2.3' }
} catch (error) {
    console.error('Health check failed:', error.message);
}

Response Fields

FieldTypeDescription
statusstringCurrent health status of the service (typically “healthy”)
api_versionstringVersion of the API interface (e.g., “v1”)
versionstringVersion of the CyborgDB application/service