@healthcloudai/hc-telehealth-connector
v0.1.1
Published
Healthcheck Telehealth SDK with TypeScript
Downloads
93
Maintainers
Readme
Healthcheck Telehealth Connector
This library provides a client for interacting with the Healthcheck Telehealth Token API.
It is built on top of the shared Healthcheck HTTP and Login connectors and can be used from
TypeScript or JavaScript applications.
The connector is responsible for securely generating a telehealth session token, which can be used to initialize telehealth or video services on the client side.
Features
- Generate telehealth session tokens
- Built on shared Healthcheck HttpClient and authentication layer
- Automatically includes authorization headers
- Lightweight and reusable across web and mobile applications
Installation
npm install @healthcloudai/hc-telehealth-connector \
@healthcloudai/hc-login-connector \
@healthcloudai/hc-httpImport
import { HCTelehealthTokenClient } from "@healthcloudai/hc-telehealth-connector";
import { HCLoginClient } from "@healthcloudai/hc-login-connector";
import { FetchClient } from "@healthcloudai/hc-http";Usage
Configuration
import { HCTelehealthTokenClient } from "@healthcloudai/hc-telehealth-connector";
import { HCLoginClient } from "@healthcloudai/hc-login-connector";
import { FetchClient } from "@healthcloudai/hc-http";
const httpClient = new FetchClient();
const authClient = new HCLoginClient(/* auth configuration */);
const telehealthClient = new HCTelehealthTokenClient(
httpClient,
authClient
);API Key
Use setApiKey(...) to attach an API key header to requests from HCTelehealthTokenClient.
const apiKey = process.env.HEALTHCLOUD_API_KEY;
if (!apiKey) {
throw new Error("HEALTHCLOUD_API_KEY is required.");
}
telehealthClient.setApiKey("x-api-key", apiKey);- Header name should be
x-api-key.
Connect to Telehealth Token Server
const tokenResponse = await telehealthClient.connectToTokenServer();The response contains the telehealth token payload returned by the backend and can be used to initialize a telehealth session (for example a video call or provider connection).
How It Works
HCLoginClient
- Handles authentication
- Resolves base API URL
- Provides authorization headers
HttpClient
- Responsible for all HTTP communication
HCTelehealthTokenClient
- Combines authentication and HTTP layers
- Exposes a simple API for generating telehealth tokens
