Amazon Connect Agent Workspace Contact API - Agent Workspace

Amazon Connect Agent Workspace Contact API

The SDK provides an ContactClient which serves as an interface that your app in Amazon Connect Agent Workspace can use to subscribe to contact events and make contact data requests.

The ContactClient accepts an optional constructor argument, ConnectClientConfig which itself is defined as:

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

If you do not provide a value for this config, then the client will default to using the AmazonConnectProvider set in the global provider scope. You can also manually configure this using setGlobalProvider.

You can instantiate the agent client as follows:

import { ContactClient } from "@amazon-connect/contact"; const contactClient = new ContactClient();
Note

For the zero-arg constructor demonstrated above to work correctly, you must first instantiate the app which will set up the default AmazonConnectProvider. This is the recommended option.

Alternatively, providing a constructor argument:

import { ContactClient } from "@amazon-connect/contact"; const contactClient = new ContactClient({ context: sampleContext, provider: sampleProvider });

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