Skip to content

@egain/ai-agent-sdk API Reference - v0.1.1 / PlatformComponentService

Interface: PlatformComponentService

Contract that platform connector scripts must implement.

All methods except initPlatform are optional — the SDK calls them when present and silently skips them when absent.

Table of contents

Properties

Properties

initPlatform

initPlatform: (hookContract: HookContract) => Promise<void>

Main connector initialization (e.g., connecting to Genesys/NICE). Called after authentication, before the CC pipeline starts.

Type declaration

▸ (hookContract): Promise<void>

Parameters
NameType
hookContractHookContract
Returns

Promise<void>

Defined in

core/platform/PlatformComponentService.ts:23


getPortalList

Optional getPortalList: (filteredPortals: Portal[]) => Portal[] | Promise<Portal[]>

Filter or reorder the portal list after fetching.

Type declaration

▸ (filteredPortals): Portal[] | Promise<Portal[]>

Parameters
NameType
filteredPortalsPortal[]
Returns

Portal[] | Promise<Portal[]>

Defined in

core/platform/PlatformComponentService.ts:26


getDefaultPortal

Optional getDefaultPortal: (portalList: Portal[]) => null | Portal | Promise<null | Portal>

Auto-select a default portal. Receives the output of getPortalList. Return null to fall through to count-based logic.

Type declaration

▸ (portalList): null | Portal | Promise<null | Portal>

Parameters
NameType
portalListPortal[]
Returns

null | Portal | Promise<null | Portal>

Defined in

core/platform/PlatformComponentService.ts:29


onPortalSelected

Optional onPortalSelected: (portal: Portal) => Record<string, string[]> | Promise<Record<string, string[]>>

Called after a portal is selected. Returns filter tags (Record<string, string[]>) stored via setUserFilterTags.

Type declaration

▸ (portal): Record<string, string[]> | Promise<Record<string, string[]>>

Parameters
NameType
portalPortal
Returns

Record<string, string[]> | Promise<Record<string, string[]>>

Defined in

core/platform/PlatformComponentService.ts:32


addCustomAuthScopes

Optional addCustomAuthScopes: (scopes: string[]) => string[] | Promise<string[]>

Modify OAuth scopes before authentication. Returns the augmented scopes array.

Type declaration

▸ (scopes): string[] | Promise<string[]>

Parameters
NameType
scopesstring[]
Returns

string[] | Promise<string[]>

Defined in

core/platform/PlatformComponentService.ts:35


loadCustomHook

Optional loadCustomHook: (hookContract: HookContract) => void

Register custom hooks on the HookContract.

Type declaration

▸ (hookContract): void

Parameters
NameType
hookContractHookContract
Returns

void

Defined in

core/platform/PlatformComponentService.ts:38


setHookContract

Optional setHookContract: (hookContract: HookContract) => void

Receive the HookContract for bidirectional communication with the SDK.

Type declaration

▸ (hookContract): void

Parameters
NameType
hookContractHookContract
Returns

void

Defined in

core/platform/PlatformComponentService.ts:41

Released under the MIT License.