View a markdown version of this page

Connect Customer SDK Agent API - Agent Workspace

Connect Customer SDK Agent API

The Connect Customer SDK provides an AgentClient which serves as an interface that your app in the Connect Customer agent workspace can use to subscribe to agent events and make agent data requests.

To create an AgentClient, pass it the provider that AmazonConnectApp.init returns. For details, see Initialize the Connect Customer SDK in your application for Connect Customer agent workspace. This is the recommended option.

import { AmazonConnectApp } from "@amazon-connect/app"; import { AgentClient } from "@amazon-connect/contact"; const { provider } = AmazonConnectApp.init({ onCreate: async (event) => { // Your app is ready. }, }); const agentClient = new AgentClient(provider);

The constructor argument has the type ConnectClientConfig, which is defined as follows:

type ConnectClientConfig = | AmazonConnectProvider | { context: ModuleContext; provider?: AmazonConnectProvider } | { provider: AmazonConnectProvider };

You can also pass the provider inside an object, for example new AgentClient({ provider }).

The following sections describe API calls for working with the Agent API.