@aws-sdk/client-connect
TypeScript icon, indicating that this package has built-in type declarations

3.565.0 • Public • Published

@aws-sdk/client-connect

Description

AWS SDK for JavaScript Connect Client for Node.js, Browser and React Native.

Amazon Connect is a cloud-based contact center solution that you use to set up and manage a customer contact center and provide reliable customer engagement at any scale.

Amazon Connect provides metrics and real-time reporting that enable you to optimize contact routing. You can also resolve customer issues more efficiently by getting customers in touch with the appropriate agents.

There are limits to the number of Amazon Connect resources that you can create. There are also limits to the number of requests that you can make per second. For more information, see Amazon Connect Service Quotas in the Amazon Connect Administrator Guide.

You can connect programmatically to an Amazon Web Services service by using an endpoint. For a list of Amazon Connect endpoints, see Amazon Connect Endpoints.

Installing

To install the this package, simply type add or install @aws-sdk/client-connect using your favorite package manager:

  • npm install @aws-sdk/client-connect
  • yarn add @aws-sdk/client-connect
  • pnpm add @aws-sdk/client-connect

Getting Started

Import

The AWS SDK is modulized by clients and commands. To send a request, you only need to import the ConnectClient and the commands you need, for example ListInstancesCommand:

// ES5 example
const { ConnectClient, ListInstancesCommand } = require("@aws-sdk/client-connect");
// ES6+ example
import { ConnectClient, ListInstancesCommand } from "@aws-sdk/client-connect";

Usage

To send a request, you:

  • Initiate client with configuration (e.g. credentials, region).
  • Initiate command with input parameters.
  • Call send operation on client with command object as input.
  • If you are using a custom http handler, you may call destroy() to close open connections.
// a client can be shared by different commands.
const client = new ConnectClient({ region: "REGION" });

const params = {
  /** input parameters */
};
const command = new ListInstancesCommand(params);

Async/await

We recommend using await operator to wait for the promise returned by send operation as follows:

// async/await.
try {
  const data = await client.send(command);
  // process data.
} catch (error) {
  // error handling.
} finally {
  // finally.
}

Async-await is clean, concise, intuitive, easy to debug and has better error handling as compared to using Promise chains or callbacks.

Promises

You can also use Promise chaining to execute send operation.

client.send(command).then(
  (data) => {
    // process data.
  },
  (error) => {
    // error handling.
  }
);

Promises can also be called using .catch() and .finally() as follows:

client
  .send(command)
  .then((data) => {
    // process data.
  })
  .catch((error) => {
    // error handling.
  })
  .finally(() => {
    // finally.
  });

Callbacks

We do not recommend using callbacks because of callback hell, but they are supported by the send operation.

// callbacks.
client.send(command, (err, data) => {
  // process err and data.
});

v2 compatible style

The client can also send requests using v2 compatible style. However, it results in a bigger bundle size and may be dropped in next major version. More details in the blog post on modular packages in AWS SDK for JavaScript

import * as AWS from "@aws-sdk/client-connect";
const client = new AWS.Connect({ region: "REGION" });

// async/await.
try {
  const data = await client.listInstances(params);
  // process data.
} catch (error) {
  // error handling.
}

// Promises.
client
  .listInstances(params)
  .then((data) => {
    // process data.
  })
  .catch((error) => {
    // error handling.
  });

// callbacks.
client.listInstances(params, (err, data) => {
  // process err and data.
});

Troubleshooting

When the service returns an exception, the error will include the exception information, as well as response metadata (e.g. request id).

try {
  const data = await client.send(command);
  // process data.
} catch (error) {
  const { requestId, cfId, extendedRequestId } = error.$metadata;
  console.log({ requestId, cfId, extendedRequestId });
  /**
   * The keys within exceptions are also parsed.
   * You can access them by specifying exception names:
   * if (error.name === 'SomeServiceException') {
   *     const value = error.specialKeyInException;
   * }
   */
}

Getting Help

Please use these community resources for getting help. We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them.

To test your universal JavaScript code in Node.js, browser and react-native environments, visit our code samples repo.

Contributing

This client code is generated automatically. Any modifications will be overwritten the next time the @aws-sdk/client-connect package is updated. To contribute to client you can check our generate clients scripts.

License

This SDK is distributed under the Apache License, Version 2.0, see LICENSE for more information.

Client Commands (Operations List)

ActivateEvaluationForm

Command API Reference / Input / Output

AssociateAnalyticsDataSet

Command API Reference / Input / Output

AssociateApprovedOrigin

Command API Reference / Input / Output

AssociateBot

Command API Reference / Input / Output

AssociateDefaultVocabulary

Command API Reference / Input / Output

AssociateFlow

Command API Reference / Input / Output

AssociateInstanceStorageConfig

Command API Reference / Input / Output

AssociateLambdaFunction

Command API Reference / Input / Output

AssociateLexBot

Command API Reference / Input / Output

AssociatePhoneNumberContactFlow

Command API Reference / Input / Output

AssociateQueueQuickConnects

Command API Reference / Input / Output

AssociateRoutingProfileQueues

Command API Reference / Input / Output

AssociateSecurityKey

Command API Reference / Input / Output

AssociateTrafficDistributionGroupUser

Command API Reference / Input / Output

AssociateUserProficiencies

Command API Reference / Input / Output

BatchAssociateAnalyticsDataSet

Command API Reference / Input / Output

BatchDisassociateAnalyticsDataSet

Command API Reference / Input / Output

BatchGetFlowAssociation

Command API Reference / Input / Output

BatchPutContact

Command API Reference / Input / Output

ClaimPhoneNumber

Command API Reference / Input / Output

CreateAgentStatus

Command API Reference / Input / Output

CreateContactFlow

Command API Reference / Input / Output

CreateContactFlowModule

Command API Reference / Input / Output

CreateEvaluationForm

Command API Reference / Input / Output

CreateHoursOfOperation

Command API Reference / Input / Output

CreateInstance

Command API Reference / Input / Output

CreateIntegrationAssociation

Command API Reference / Input / Output

CreateParticipant

Command API Reference / Input / Output

CreatePersistentContactAssociation

Command API Reference / Input / Output

CreatePredefinedAttribute

Command API Reference / Input / Output

CreatePrompt

Command API Reference / Input / Output

CreateQueue

Command API Reference / Input / Output

CreateQuickConnect

Command API Reference / Input / Output

CreateRoutingProfile

Command API Reference / Input / Output

CreateRule

Command API Reference / Input / Output

CreateSecurityProfile

Command API Reference / Input / Output

CreateTaskTemplate

Command API Reference / Input / Output

CreateTrafficDistributionGroup

Command API Reference / Input / Output

CreateUseCase

Command API Reference / Input / Output

CreateUser

Command API Reference / Input / Output

CreateUserHierarchyGroup

Command API Reference / Input / Output

CreateView

Command API Reference / Input / Output

CreateViewVersion

Command API Reference / Input / Output

CreateVocabulary

Command API Reference / Input / Output

DeactivateEvaluationForm

Command API Reference / Input / Output

DeleteContactEvaluation

Command API Reference / Input / Output

DeleteContactFlow

Command API Reference / Input / Output

DeleteContactFlowModule

Command API Reference / Input / Output

DeleteEvaluationForm

Command API Reference / Input / Output

DeleteHoursOfOperation

Command API Reference / Input / Output

DeleteInstance

Command API Reference / Input / Output

DeleteIntegrationAssociation

Command API Reference / Input / Output

DeletePredefinedAttribute

Command API Reference / Input / Output

DeletePrompt

Command API Reference / Input / Output

DeleteQueue

Command API Reference / Input / Output

DeleteQuickConnect

Command API Reference / Input / Output

DeleteRoutingProfile

Command API Reference / Input / Output

DeleteRule

Command API Reference / Input / Output

DeleteSecurityProfile

Command API Reference / Input / Output

DeleteTaskTemplate

Command API Reference / Input / Output

DeleteTrafficDistributionGroup

Command API Reference / Input / Output

DeleteUseCase

Command API Reference / Input / Output

DeleteUser

Command API Reference / Input / Output

DeleteUserHierarchyGroup

Command API Reference / Input / Output

DeleteView

Command API Reference / Input / Output

DeleteViewVersion

Command API Reference / Input / Output

DeleteVocabulary

Command API Reference / Input / Output

DescribeAgentStatus

Command API Reference / Input / Output

DescribeContact

Command API Reference / Input / Output

DescribeContactEvaluation

Command API Reference / Input / Output

DescribeContactFlow

Command API Reference / Input / Output

DescribeContactFlowModule

Command API Reference / Input / Output

DescribeEvaluationForm

Command API Reference / Input / Output

DescribeHoursOfOperation

Command API Reference / Input / Output

DescribeInstance

Command API Reference / Input / Output

DescribeInstanceAttribute

Command API Reference / Input / Output

DescribeInstanceStorageConfig

Command API Reference / Input / Output

DescribePhoneNumber

Command API Reference / Input / Output

DescribePredefinedAttribute

Command API Reference / Input / Output

DescribePrompt

Command API Reference / Input / Output

DescribeQueue

Command API Reference / Input / Output

DescribeQuickConnect

Command API Reference / Input / Output

DescribeRoutingProfile

Command API Reference / Input / Output

DescribeRule

Command API Reference / Input / Output

DescribeSecurityProfile

Command API Reference / Input / Output

DescribeTrafficDistributionGroup

Command API Reference / Input / Output

DescribeUser

Command API Reference / Input / Output

DescribeUserHierarchyGroup

Command API Reference / Input / Output

DescribeUserHierarchyStructure

Command API Reference / Input / Output

DescribeView

Command API Reference / Input / Output

DescribeVocabulary

Command API Reference / Input / Output

DisassociateAnalyticsDataSet

Command API Reference / Input / Output

DisassociateApprovedOrigin

Command API Reference / Input / Output

DisassociateBot

Command API Reference / Input / Output

DisassociateFlow

Command API Reference / Input / Output

DisassociateInstanceStorageConfig

Command API Reference / Input / Output

DisassociateLambdaFunction

Command API Reference / Input / Output

DisassociateLexBot

Command API Reference / Input / Output

DisassociatePhoneNumberContactFlow

Command API Reference / Input / Output

DisassociateQueueQuickConnects

Command API Reference / Input / Output

DisassociateRoutingProfileQueues

Command API Reference / Input / Output

DisassociateSecurityKey

Command API Reference / Input / Output

DisassociateTrafficDistributionGroupUser

Command API Reference / Input / Output

DisassociateUserProficiencies

Command API Reference / Input / Output

DismissUserContact

Command API Reference / Input / Output

GetContactAttributes

Command API Reference / Input / Output

GetCurrentMetricData

Command API Reference / Input / Output

GetCurrentUserData

Command API Reference / Input / Output

GetFederationToken

Command API Reference / Input / Output

GetFlowAssociation

Command API Reference / Input / Output

GetMetricData

Command API Reference / Input / Output

GetMetricDataV2

Command API Reference / Input / Output

GetPromptFile

Command API Reference / Input / Output

GetTaskTemplate

Command API Reference / Input / Output

GetTrafficDistribution

Command API Reference / Input / Output

ImportPhoneNumber

Command API Reference / Input / Output

ListAgentStatuses

Command API Reference / Input / Output

ListAnalyticsDataAssociations

Command API Reference / Input / Output

ListApprovedOrigins

Command API Reference / Input / Output

ListBots

Command API Reference / Input / Output

ListContactEvaluations

Command API Reference / Input / Output

ListContactFlowModules

Command API Reference / Input / Output

ListContactFlows

Command API Reference / Input / Output

ListContactReferences

Command API Reference / Input / Output

ListDefaultVocabularies

Command API Reference / Input / Output

ListEvaluationForms

Command API Reference / Input / Output

ListEvaluationFormVersions

Command API Reference / Input / Output

ListFlowAssociations

Command API Reference / Input / Output

ListHoursOfOperations

Command API Reference / Input / Output

ListInstanceAttributes

Command API Reference / Input / Output

ListInstances

Command API Reference / Input / Output

ListInstanceStorageConfigs

Command API Reference / Input / Output

ListIntegrationAssociations

Command API Reference / Input / Output

ListLambdaFunctions

Command API Reference / Input / Output

ListLexBots

Command API Reference / Input / Output

ListPhoneNumbers

Command API Reference / Input / Output

ListPhoneNumbersV2

Command API Reference / Input / Output

ListPredefinedAttributes

Command API Reference / Input / Output

ListPrompts

Command API Reference / Input / Output

ListQueueQuickConnects

Command API Reference / Input / Output

ListQueues

Command API Reference / Input / Output

ListQuickConnects

Command API Reference / Input / Output

ListRealtimeContactAnalysisSegmentsV2

Command API Reference / Input / Output

ListRoutingProfileQueues

Command API Reference / Input / Output

ListRoutingProfiles

Command API Reference / Input / Output

ListRules

Command API Reference / Input / Output

ListSecurityKeys

Command API Reference / Input / Output

ListSecurityProfileApplications

Command API Reference / Input / Output

ListSecurityProfilePermissions

Command API Reference / Input / Output

ListSecurityProfiles

Command API Reference / Input / Output

ListTagsForResource

Command API Reference / Input / Output

ListTaskTemplates

Command API Reference / Input / Output

ListTrafficDistributionGroups

Command API Reference / Input / Output

ListTrafficDistributionGroupUsers

Command API Reference / Input / Output

ListUseCases

Command API Reference / Input / Output

ListUserHierarchyGroups

Command API Reference / Input / Output

ListUserProficiencies

Command API Reference / Input / Output

ListUsers

Command API Reference / Input / Output

ListViews

Command API Reference / Input / Output

ListViewVersions

Command API Reference / Input / Output

MonitorContact

Command API Reference / Input / Output

PauseContact

Command API Reference / Input / Output

PutUserStatus

Command API Reference / Input / Output

ReleasePhoneNumber

Command API Reference / Input / Output

ReplicateInstance

Command API Reference / Input / Output

ResumeContact

Command API Reference / Input / Output

ResumeContactRecording

Command API Reference / Input / Output

SearchAvailablePhoneNumbers

Command API Reference / Input / Output

SearchContacts

Command API Reference / Input / Output

SearchHoursOfOperations

Command API Reference / Input / Output

SearchPredefinedAttributes

Command API Reference / Input / Output

SearchPrompts

Command API Reference / Input / Output

SearchQueues

Command API Reference / Input / Output

SearchQuickConnects

Command API Reference / Input / Output

SearchResourceTags

Command API Reference / Input / Output

SearchRoutingProfiles

Command API Reference / Input / Output

SearchSecurityProfiles

Command API Reference / Input / Output

SearchUsers

Command API Reference / Input / Output

SearchVocabularies

Command API Reference / Input / Output

SendChatIntegrationEvent

Command API Reference / Input / Output

StartChatContact

Command API Reference / Input / Output

StartContactEvaluation

Command API Reference / Input / Output

StartContactRecording

Command API Reference / Input / Output

StartContactStreaming

Command API Reference / Input / Output

StartOutboundVoiceContact

Command API Reference / Input / Output

StartTaskContact

Command API Reference / Input / Output

StartWebRTCContact

Command API Reference / Input / Output

StopContact

Command API Reference / Input / Output

StopContactRecording

Command API Reference / Input / Output

StopContactStreaming

Command API Reference / Input / Output

SubmitContactEvaluation

Command API Reference / Input / Output

SuspendContactRecording

Command API Reference / Input / Output

TagContact

Command API Reference / Input / Output

TagResource

Command API Reference / Input / Output

TransferContact

Command API Reference / Input / Output

UntagContact

Command API Reference / Input / Output

UntagResource

Command API Reference / Input / Output

UpdateAgentStatus

Command API Reference / Input / Output

UpdateContact

Command API Reference / Input / Output

UpdateContactAttributes

Command API Reference / Input / Output

UpdateContactEvaluation

Command API Reference / Input / Output

UpdateContactFlowContent

Command API Reference / Input / Output

UpdateContactFlowMetadata

Command API Reference / Input / Output

UpdateContactFlowModuleContent

Command API Reference / Input / Output

UpdateContactFlowModuleMetadata

Command API Reference / Input / Output

UpdateContactFlowName

Command API Reference / Input / Output

UpdateContactRoutingData

Command API Reference / Input / Output

UpdateContactSchedule

Command API Reference / Input / Output

UpdateEvaluationForm

Command API Reference / Input / Output

UpdateHoursOfOperation

Command API Reference / Input / Output

UpdateInstanceAttribute

Command API Reference / Input / Output

UpdateInstanceStorageConfig

Command API Reference / Input / Output

UpdateParticipantRoleConfig

Command API Reference / Input / Output

UpdatePhoneNumber

Command API Reference / Input / Output

UpdatePhoneNumberMetadata

Command API Reference / Input / Output

UpdatePredefinedAttribute

Command API Reference / Input / Output

UpdatePrompt

Command API Reference / Input / Output

UpdateQueueHoursOfOperation

Command API Reference / Input / Output

UpdateQueueMaxContacts

Command API Reference / Input / Output

UpdateQueueName

Command API Reference / Input / Output

UpdateQueueOutboundCallerConfig

Command API Reference / Input / Output

UpdateQueueStatus

Command API Reference / Input / Output

UpdateQuickConnectConfig

Command API Reference / Input / Output

UpdateQuickConnectName

Command API Reference / Input / Output

UpdateRoutingProfileAgentAvailabilityTimer

Command API Reference / Input / Output

UpdateRoutingProfileConcurrency

Command API Reference / Input / Output

UpdateRoutingProfileDefaultOutboundQueue

Command API Reference / Input / Output

UpdateRoutingProfileName

Command API Reference / Input / Output

UpdateRoutingProfileQueues

Command API Reference / Input / Output

UpdateRule

Command API Reference / Input / Output

UpdateSecurityProfile

Command API Reference / Input / Output

UpdateTaskTemplate

Command API Reference / Input / Output

UpdateTrafficDistribution

Command API Reference / Input / Output

UpdateUserHierarchy

Command API Reference / Input / Output

UpdateUserHierarchyGroupName

Command API Reference / Input / Output

UpdateUserHierarchyStructure

Command API Reference / Input / Output

UpdateUserIdentityInfo

Command API Reference / Input / Output

UpdateUserPhoneConfig

Command API Reference / Input / Output

UpdateUserProficiencies

Command API Reference / Input / Output

UpdateUserRoutingProfile

Command API Reference / Input / Output

UpdateUserSecurityProfiles

Command API Reference / Input / Output

UpdateViewContent

Command API Reference / Input / Output

UpdateViewMetadata

Command API Reference / Input / Output

Readme

Keywords

none

Package Sidebar

Install

npm i @aws-sdk/client-connect

Weekly Downloads

108,343

Version

3.565.0

License

Apache-2.0

Unpacked Size

4.49 MB

Total Files

983

Last publish

Collaborators

  • mattsb42-aws
  • kuhe
  • amzn-oss
  • aws-sdk-bot
  • trivikr-aws