Communication: hbf-core-api
This is a shared TypeScript npm library, not a running service. It has no inbound HTTP interface and no ports. It communicates outbound only, via axios, to a single target: hbf-core.
Library Role
@helvia/hbf-core-api is imported by Node.js services at build time. Each consuming service instantiates HBFCoreApi at startup (or per-request) and uses the resulting sub-clients to call hbf-core. The library does not run independently.
Instantiation
import { HBFCoreApi } from "@helvia/hbf-core-api";
const coreApi = new HBFCoreApi(process.env.CORE_URL, process.env.CORE_TOKEN);
url and token are stored in the instance. No HTTP calls are made at construction time. Each getter creates a fresh sub-client instance bound to the parent HBFCoreApi.
HTTP Client Configuration
All requests go through requestHBFCore (or requestHBFCoreMultipart for file uploads) in src/core.ts.
| Concern | Detail |
|---|---|
| Base URL | Prepended from url constructor arg. Callers typically set this from CORE_URL env var. |
| Auth header | Authorization: Bearer <token> on every request. Token from token constructor arg, typically CORE_TOKEN env var. |
| Content-Type | application/json (standard requests). Omitted for multipart/form-data uploads. |
| Accept | application/json |
| HTTP client | axios 1.8 |
| No timeout | axios default (no timeout set). Requests can hang indefinitely. |
Exported Client Classes
All clients are accessed as getters on HBFCoreApi. Defined in src/core.ts, implemented in src/clients/.
| Getter | Class | src/clients/ file | hbf-core resource |
|---|---|---|---|
.TenantsClient | TenantsClient | TenantsClient.ts | /tenants |
.OrganizationsClient | OrganizationClient | OrganizationClient.ts | /organizations |
.BotContentClient | BotContentClient | BotContentClient.ts | bot content authoring |
.BotDeploymentClient | BotDeploymentClient | BotDeploymentClient.ts | /bot-deployments |
.ResponsesClient | ResponsesClient | ResponsesClient.ts | response templates |
.AnalyticsClient | AnalyticsClient | AnalyticsClient.ts | analytics queries |
.BroadcastsClient | BroadcastsClient | BroadcastsClient.ts | broadcasts |
.GroupsClient | GroupsClient | GroupsClient.ts | groups |
.UsersClient | UsersClient | UsersClient.ts | users |
.SubscribersClient | SubscribersClient | SubscribersClient.ts | subscribers |
.UserGroupsClient | UserGroupsClient | UserGroupsClient.ts | user groups |
.HandoverClient | HandoverClient | HandoverClient.ts | agent handover |
.FbHandoverClient | FbHandoverClient | FbHandoverClient.ts | Facebook handover |
.ChatSessionsClient | ChatSessionsClient | ChatSessionsClient.ts | chat sessions |
.SurveyClient | SurveyClient | SurveyClient.ts | surveys |
.MessagingAppsClient | MessagingAppsClient | MessagingAppsClient.ts | messaging app config |
.ElasticSearchClient | ElasticSearchClient | ElasticSearchClient.ts | Elasticsearch proxy |
.NluDetectionClient | NluDetectionClient | NluDetectionClient.ts | NLU intent detection |
.NluAgentsClient | NluAgentsClient | NluAgentsClient.ts | NLU agent management |
.NlpPipelinesClient | NlpPipelinesClient | NlpPipelinesClient.ts | NLP pipeline CRUD |
.AuditLogsClient | AuditLogsClient | AuditLogsClient.ts | audit logs |
.KnowledgeBaseClient | KnowledgeBaseClient | KnowledgeBaseClient.ts | knowledge bases |
.KnowledgeBaseArticleClient | KnowledgeBaseArticleClient | KnowledgeBaseArticleClient.ts | KB articles |
.KnowledgeBaseGroupClient | KnowledgeBaseGroupClient | KnowledgeBaseGroupClient.ts | KB groups |
.IntegrationClient | IntegrationsClient | IntegrationsClient.ts | integration config |
.TranslationsClient | TranslationsClient | TranslationsClient.ts | translations |
Note: the getter .IntegrationClient (singular) returns an IntegrationsClient instance. The naming mismatch is a known inconsistency in the source.
Consuming Services
The following services declare @helvia/hbf-core-api as a package.json dependency:
| Service | Version pinned | Primary clients used |
|---|---|---|
| hbf-bot | ^30.17.0 | TenantsClient, BotDeploymentClient, SubscribersClient, ChatSessionsClient |
| hbf-broadcast | ^18.0.0 | BroadcastsClient, SubscribersClient |
| hbf-stats | ^24.1.2 | TenantsClient, AnalyticsClient |
| hbf-session-manager | ^29.21.0 | ChatSessionsClient, TenantsClient, BotDeploymentClient |
| hbf-notifications | ^28.5.0 | UsersClient, TenantsClient |
| hbf-lcg | ^30.11.1 | HandoverClient, BotDeploymentClient, SubscribersClient |
| hbf-data-manager | ^30.4.0 | ChatSessionsClient, TenantsClient |
| hbf-data-retention | ^30.12.0 | TenantsClient, ChatSessionsClient |
| hbf-nlp | ^30.10.0 | NlpPipelinesClient, NluAgentsClient, TenantsClient |
| hbf-knowledge-manager | ^30.18.0 | KnowledgeBaseClient, KnowledgeBaseArticleClient, IntegrationClient |
| hbf-reports | ^30.8.0 | AnalyticsClient, TenantsClient |
| hbf-client-integrations | ^30.4.1 | BotDeploymentClient, SubscribersClient, TenantsClient |
| hbf-media-manager | ^30.2.0 | TenantsClient |
hbf-console (React SPA) and hbf-lcm do not consume this library directly.