@healthcloudai/hc-tenant-admin-connector
v0.0.4
Published
Healthcheck Tenant Admin SDK with TypeScript and token refresh
Maintainers
Readme
Healthcheck Tenant Admin Connector
This library provides a client for interacting with Healthcheck tenant-admin APIs. It is built on top of the shared Healthcheck HTTP layer and can be used from TypeScript or JavaScript.
Features
- Tenant admin login
- Tenant admin token refresh
- Tenant admin registration
- Tenant admin password reset flow
- Tenant admin header and dashboard retrieval
- Built on shared HttpClient and authentication layer
Installation
npm install @healthcloudai/hc-tenant-admin-connector \
@healthcloudai/hc-http
Import
import { HCTenantAdminClient } from "@healthcloudai/hc-tenant-admin-connector";
import { FetchClient } from "@healthcloudai/hc-http";
Usage
Configuration
import { HCTenantAdminClient } from "@healthcloudai/hc-tenant-admin-connector";
import { FetchClient } from "@healthcloudai/hc-http";
const httpClient = new FetchClient();
const tenantAdminClient = new HCTenantAdminClient(httpClient);
tenantAdminClient.configure("tenant-id", "dev");
Login Tenant Admin
await tenantAdminClient.loginTenantAdmin({
Data: {
Email: "[email protected]",
Password: "password",
AppPoolID: ""
}
});
Refresh Token
await tenantAdminClient.refreshToken();
Register Tenant Admin
await tenantAdminClient.registerTenantAdmin({
Data: {
Credentials: {
Email: "[email protected]",
Password: ""
},
User: {
FirstName: "John",
LastName: "Smith",
Email: "[email protected]",
Phone: "+13104023170",
BirthDate: "1987-01-22T00:00:00Z",
Gender: "Male"
}
}
});
Reset Password
await tenantAdminClient.resetPassword("[email protected]");
Confirm Reset Password
await tenantAdminClient.resetPasswordConfirm(
"[email protected]",
true,
"NewPassword123$",
"123456"
);
Get Tenant Admin Info
await tenantAdminClient.getTenantAdminInfo();
Get Tenant Admin Dashboard
await tenantAdminClient.getTenantAdminDashboard();
How It Works
- HCTenantAdminClient manages tenant-admin auth and API requests
- HttpClient is responsible for all HTTP communication
- Tenant ID is configured once via
configure(...)and applied across requests - Authenticated endpoints use the internally stored ID token
