@healthcloudai/hc-assets-connector
v0.0.5
Published
Healthcheck Assets SDK with TypeScript
Maintainers
Readme
Healthcheck Assets Connector
This connector lets you fetch authenticated content, fetch tenant-scoped public content, and update the stored user image reference. It reuses the configured login client together with the shared Healthcheck HTTP client.
Features
- Get authenticated patient content
- Get public content for the configured tenant
- Update the stored user image reference
- Reuse the configured login client for base URL, tenant context, and auth headers where needed
Installation
npm install @healthcloudai/hc-assets-connector \
@healthcloudai/hc-login-connector \
@healthcloudai/hc-httpImport
import { HCAssetsClient } from "@healthcloudai/hc-assets-connector";
import { HCLoginClient } from "@healthcloudai/hc-login-connector";
import { FetchClient } from "@healthcloudai/hc-http";Usage
Configuration
const httpClient = new FetchClient();
const loginClient = new HCLoginClient(httpClient);
loginClient.configure("demo-tenant", "dev");
await loginClient.login("[email protected]", "ExamplePassword123!");
const assetsClient = new HCAssetsClient(httpClient, loginClient);Reuse the same configured HCLoginClient instance when creating HCAssetsClient so both connectors use the same tenant and auth state.
Methods
Get Content
Public signature: assetsClient.getContent(type?)
Returns authenticated content for the current patient context.
If type is provided, the client appends it as a query string.
Current supported content categories are:
Article, Video, LegalNotice, FAQ, Guide, News, PrivacyPolicy, Announcement, and HealthTip.
const content = await assetsClient.getContent();
const privacyPolicy = await assetsClient.getContent("privacypolicy");Full API request
This method performs an authenticated GET request internally and does not send a request body.
If type is provided, the client appends it as a query string.
API response
Status:
200{
"Data": [
{
"ID": "content-id-example",
"Name": "What causes COVID?",
"Description": "<p>Example content body.</p>",
"ImageURL": null,
"ContentType": "FAQ",
"PublicationDate": "2026-03-18T08:15:20.987Z",
"ExpirationDate": null,
"ExternalLink": null,
"Article": null,
"Featured": false,
"Status": "ACTIVE",
"ThumbnailURL": null,
"VideoURL": null,
"IsFirstDocument": false,
"SelectedAccountTenantIDs": [
"demo-tenant",
"other-tenant-example"
],
"TenantID": "platformadmin"
}
],
"ErrorMessage": null,
"IsOK": true
}Get Public Content
Public signature: assetsClient.getPublicContent(type?)
Returns public content for the configured tenant.
This method sends a POST body with TenantID from loginClient.getTenantId() and does not use getAuthHeader().
If type is provided, the client appends it as a query string.
At the moment, registrationFAQ is the only valid type for this method because it is used before the user is logged in.
const publicContent = await assetsClient.getPublicContent("registrationFAQ");Full API request
{
"Data": {
"TenantID": "demo-tenant"
}
}API response
Status:
200{
"Data": [
{
"ID": "content-id-example",
"Name": "Where can I go for other questions or support?",
"Description": "<pre><code>Contact [email protected] for help.</code></pre>",
"ImageURL": null,
"ContentType": "Registration FAQ",
"PublicationDate": "2026-03-27T09:53:47.239Z",
"ExpirationDate": null,
"ExternalLink": null,
"Article": null,
"Featured": false,
"Status": "ACTIVE",
"ThumbnailURL": null,
"VideoURL": null,
"IsFirstDocument": false,
"SelectedAccountTenantIDs": [
"demo-tenant"
],
"TenantID": "platformadmin"
}
],
"ErrorMessage": null,
"IsOK": true
}How It Works
HCAssetsClientbuilds requests fromloginClient.getBaseUrl().getContent()uses authenticated headers fromloginClient.getAuthHeader().getPublicContent()builds a publicPOSTbody fromloginClient.getTenantId()and does not send auth headers.
Notes
HCLoginClientmust already be configured before using this connector.getContent()requires an authenticated login client.getPublicContent()uses tenant context from the configured login client and sends aPOSTbody.- The optional
typeargument is appended as a query string when provided. - For
getPublicContent(),registrationFAQis currently the only valid type. This method is used before the user is logged in.
