{"id":32148714,"url":"https://github.com/amazon-connect/amazon-connect-chat-ios","last_synced_at":"2026-01-23T02:04:17.500Z","repository":{"id":247853815,"uuid":"777438185","full_name":"amazon-connect/amazon-connect-chat-ios","owner":"amazon-connect","description":"Amazon Connect Chat SDK for iOS","archived":false,"fork":false,"pushed_at":"2026-01-21T07:54:49.000Z","size":220061,"stargazers_count":9,"open_issues_count":3,"forks_count":5,"subscribers_count":3,"default_branch":"main","last_synced_at":"2026-01-21T14:13:34.192Z","etag":null,"topics":["amazon-connect","amazon-connect-chat","ios-sdk","swift"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/amazon-connect.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":"NOTICE","maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-03-25T21:12:12.000Z","updated_at":"2026-01-20T22:52:35.000Z","dependencies_parsed_at":"2025-01-16T01:25:51.639Z","dependency_job_id":"4ea6f194-cde5-4181-932b-666a49cb815f","html_url":"https://github.com/amazon-connect/amazon-connect-chat-ios","commit_stats":null,"previous_names":["amazon-connect/amazon-connect-chat-ios"],"tags_count":23,"template":false,"template_full_name":"amazon-archives/__template_Apache-2.0","purl":"pkg:github/amazon-connect/amazon-connect-chat-ios","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amazon-connect%2Famazon-connect-chat-ios","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amazon-connect%2Famazon-connect-chat-ios/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amazon-connect%2Famazon-connect-chat-ios/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amazon-connect%2Famazon-connect-chat-ios/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/amazon-connect","download_url":"https://codeload.github.com/amazon-connect/amazon-connect-chat-ios/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amazon-connect%2Famazon-connect-chat-ios/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28677717,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-23T01:00:35.747Z","status":"online","status_checked_at":"2026-01-23T02:00:08.296Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["amazon-connect","amazon-connect-chat","ios-sdk","swift"],"created_at":"2025-10-21T09:03:38.888Z","updated_at":"2026-01-23T02:04:17.489Z","avatar_url":"https://github.com/amazon-connect.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Amazon Connect Chat SDK for iOS\n\n## Table of Contents\n* [About](#about)\n* [Installation Steps](#installation-steps)\n* [Getting Started](#getting-started)\n  * [How to receive messages](#how-to-receive-messages)\n* [Advanced Configuration](#advanced-configuration)\n  * [Custom Client Implementation](#custom-client-implementation)\n* [API List](#api-list)\n  * [GlobalConfig](#globalconfig)\n    * [GlobalConfig.init](#globalconfiginit)\n    * [Updating configuration](#updating-configuration)\n  * [SDKLogger](#sdklogger)\n  * [ChatSession APIs](#chatsession-apis)\n  * [ChatSession Events](#chatsession-events)\n  * [Classes and Structs](#classes-and-structs)\n* [Security](#security)\n* [License](#license)\n\n## About\nThe Amazon Connect Chat SDK for iOS is a Swift library that gives you the power to easily integrate Amazon Connect Chat directly into your native iOS applications. The Amazon Connect Chat SDK helps handle client side chat logic and back-end communications similar to the [Amazon Connect ChatJS Library](https://github.com/amazon-connect/amazon-connect-chatjs). The SDK wraps the [Amazon Connect Participant Service](https://docs.aws.amazon.com/connect/latest/APIReference/API_Operations_Amazon_Connect_Participant_Service.html) APIs and abstracts away the management of the chat session and WebSocket.  This allows you to focus on the user interface and experience while relying on the Amazon Connect Chat SDK to interact with all the back-end services.  This approach still requires using your own chat back end to call the Amazon Connect [StartChatContact](https://docs.aws.amazon.com/connect/latest/APIReference/API_StartChatContact.html) API to initiate contact. You can read instructions on how to quickly set up a StartChatContact Lambda from our [startChatContactAPI](https://github.com/amazon-connect/amazon-connect-chat-ui-examples/tree/master/cloudformationTemplates/startChatContactAPI) example.\n\n## Installation Steps\nThere are three options to install the Amazon Connect Chat SDK for iOS to your xCode project:\n\n### Install via [Cocoapods](https://cocoapods.org/)\n\nIn your `Podfile`:\n```\n    * Reference the AmazonConnectChatIOS pod in your Podfile\n    * target 'YourProject' do\n            pod 'AmazonConnectChatIOS'\n            ...\n        end\n```\nThen run `pod install` in your project's root directory\n\n### Install via [Swift Package Manager](https://www.swift.org/documentation/package-manager/)\n * Open your project in Xcode\n * Go to **File \u003e Add Package Dependencies...**\n * In the field **Enter package repository URL**, enter “https://github.com/amazon-connect/amazon-connect-chat-ios\".\n * Select the desired target project and click **Add Package**\n\n### Download Binaries Directly from GitHub Releases\n\n1. Go to the [Amazon Connect Chat SDK for iOS GitHub Releases](https://github.com/amazon-connect/amazon-connect-chat-ios/releases) page.\n2. Download the latest release of the `AmazonConnectChatIOS.xcframework`.\n3. Unzip the downloaded file, if necessary.\n4. Drag and drop the `AmazonConnectChatIOS.xcframework` into your Xcode project.\n\n\u003e⚠️ Important: Please remember to add 'AWSCore' and 'AWSConnectParticipant' from [AWS IOS SDK](https://github.com/aws-amplify/aws-sdk-ios) while using binaries.\n\n\n#### How to Import the XCFramework\n\nOnce you have added the `AmazonConnectChatIOS.xcframework` to your project, you need to import it into your code. Here are the steps:\n\n1. **Import the Framework in Your Swift Code**:\n    ```swift\n    import AmazonConnectChatIOS\n    ```\n\nBy following these steps, you can integrate the Amazon Connect Chat SDK for iOS into your project using CocoaPods, Swift Package Manager, or by directly adding the XCFramework. Make sure to follow the specific installation instructions for each method to ensure a smooth setup process.\n\n## Getting Started\n\nThe first step to leveraging the Amazon Connect Chat SDK after installation is to import the library into your file. Next, let's call the StartChatContact API and pass the response details into the SDK’s ChatSession object.  Here is an [example](https://github.com/amazon-connect/amazon-connect-chat-ui-examples/blob/master/mobileChatExamples/iOSChatExample/AmazonConnectChatIOSDemo/Models/ChatManager.swift#L137C18-L137C34) of how we would set this up in Swift. For reference, you can visit the [iOSChatExample demo](https://github.com/amazon-connect/amazon-connect-chat-ui-examples/tree/master/mobileChatExamples/iOSChatExample) within the [Amazon Connect Chat UI Examples](https://github.com/amazon-connect/amazon-connect-chat-ui-examples/tree/master) GitHub repository.\n\nThe majority of the SDKs functionality will be accessed through the ChatSession object. In order to use this object in the file, we have to first import the AmazonConnectChatIOS library via:\n\n```\nimport AmazonConnectChatIOS\n```\n\nNext, we can create a ChatManager class that helps bridge UI and SDK communication.  This class should be responsible for managing interactions with the ChatSession object. We can either add it as a class property or reference it directly using ChatSession.shared. \n\n```\nclass ChatManager: ObservableObject {\n    private var chatSession = ChatSession.shared\n\n    ...\n```\n\nBefore using the chatSession object, we need to set the config for it via the GlobalConfig object.  Most importantly, the GlobalConfig object will be used to set the AWS region that your Connect instance lives in.  Here is an example of how to configure the ChatSession object:\n\n```\ninit() {\n    let globalConfig = GlobalConfig(region: .USEast1)\n    self.chatSession = ChatSession.shared\n    chatSession.configure(config: globalConfig)\n    ...\n}\n```\n\nFrom here, you are now ready to interact with the chat via the `ChatSession` object.\n\n### How to receive messages\n\nThe Amazon Connect Chat SDK for iOS provides two methods to receive messages.\n\n1. Use [ChatSession.onTranscriptUpdated](#chatsessionontranscriptupdated)\n  * This event will pass back the entire transcript every time the transcript is updated. This will return the transcript via an array of [TranscriptItem](#transcriptitem)\n\n2. Use [ChatSession.onMessageReceived](#chatsessiononmessagereceived)\n  * This event will pass back each message that is received by the WebSocket.  The event handler will be passed a single [TranscriptItem](#transcriptitem).\n\n### How to handle events\n\nThe SDK provides event callbacks for chat experiences:\n\n```swift\n// Typing indicators\nchatSession.onTyping = { event in\n    print(\"Participant \\(event.participant!) is typing...\")\n    // Show typing indicator in UI\n}\n\n// Message receipts\nchatSession.onReadReceipt = { event in\n    print(\"Message \\(event.id) was read by participant \\(event.participant!)\")\n    // Update message status to \"Read\"\n}\n\nchatSession.onDeliveredReceipt = { event in\n    print(\"Message \\(event.id) was delivered to participant \\(event.participant!)\")\n    // Update message status to \"Delivered\"\n}\n\n// Participant state changes\nchatSession.onParticipantIdle = { event in\n    print(\"Participant \\(event.displayName!) went idle\")\n    // Show idle indicator\n}\n\nchatSession.onParticipantReturned = { event in\n    print(\"Participant \\(event.displayName!) returned\")\n    // Hide idle indicator\n}\n\n// Chat lifecycle events\nchatSession.onChatRehydrated = { event in\n    print(\"Chat session restored from previous session\")\n    // Handle chat restoration\n}\n```\n\n### Event Property Reference\n\nAll events provide an `Event` object with these properties. Here's what's available in each event type:\n\n#### Typing Events\n```swift\nchatSession.onTyping = { event in\n    // Available properties:\n    // - event.id: Event ID (String)\n    // - event.timeStamp: When typing started (String, ISO 8601)\n    // - event.participant: Participant role, e.g. \"AGENT\", \"CUSTOMER\" (String?)\n    // - event.displayName: Participant's display name (String?)\n    // - event.contentType: \"application/vnd.amazonaws.connect.event.typing\"\n    // - event.eventDirection: .Common\n}\n```\n\n#### Message Receipt Events\n```swift\nchatSession.onReadReceipt = { event in\n    // Available properties:\n    // - event.id: Receipt event ID (String)\n    // - event.timeStamp: When message was read (String, ISO 8601)\n    // - event.participant: Participant ID (UUID) who read the message (String?)\n    // - event.displayName: nil (receipts don't have display names)\n    // - event.contentType: \"application/vnd.amazonaws.connect.event.message.read\"\n    // - event.eventDirection: .Incoming\n    // - event.serializedContent[\"receipt\"]: Original receipt data\n    // - event.serializedContent[\"originalMessage\"]: Original message metadata\n}\n\nchatSession.onDeliveredReceipt = { event in\n    // Available properties:\n    // - event.id: Receipt event ID (String)\n    // - event.timeStamp: When message was delivered (String, ISO 8601)\n    // - event.participant: Participant ID (UUID) who received the message (String?)\n    // - event.displayName: nil (receipts don't have display names)\n    // - event.contentType: \"application/vnd.amazonaws.connect.event.message.delivered\"\n    // - event.eventDirection: .Incoming\n    // - event.serializedContent[\"receipt\"]: Original receipt data\n    // - event.serializedContent[\"originalMessage\"]: Original message metadata\n}\n```\n\n#### Participant State Events\n```swift\nchatSession.onParticipantIdle = { event in\n    // Available properties:\n    // - event.id: Event ID (String)\n    // - event.timeStamp: When participant went idle (String, ISO 8601)\n    // - event.participant: Participant role, e.g. \"AGENT\", \"CUSTOMER\" (String?)\n    // - event.displayName: Participant's display name (String?)\n    // - event.contentType: \"application/vnd.amazonaws.connect.event.participant.idle\"\n    // - event.eventDirection: .Common\n}\n\nchatSession.onParticipantReturned = { event in\n    // Available properties:\n    // - event.id: Event ID (String)\n    // - event.timeStamp: When participant returned (String, ISO 8601)\n    // - event.participant: Participant role, e.g. \"AGENT\", \"CUSTOMER\" (String?)\n    // - event.displayName: Participant's display name (String?)\n    // - event.contentType: \"application/vnd.amazonaws.connect.event.participant.returned\"\n    // - event.eventDirection: .Common\n}\n\nchatSession.onAutoDisconnection = { event in\n    // Available properties:\n    // - event.id: Event ID (String)\n    // - event.timeStamp: When auto-disconnection occurred (String, ISO 8601)\n    // - event.participant: Participant role, e.g. \"AGENT\", \"CUSTOMER\" (String?)\n    // - event.displayName: Participant's display name (String?)\n    // - event.contentType: \"application/vnd.amazonaws.connect.event.participant.autodisconnection\"\n    // - event.eventDirection: .Common\n}\n\nchatSession.onParticipantInvited = { event in\n    // Available properties:\n    // - event.id: Event ID (String)\n    // - event.timeStamp: When participant was invited (String, ISO 8601)\n    // - event.participant: Participant role, e.g. \"AGENT\", \"CUSTOMER\" (String?)\n    // - event.displayName: Participant's display name (String?)\n    // - event.contentType: \"application/vnd.amazonaws.connect.event.participant.invited\"\n    // - event.eventDirection: .Common\n}\n```\n\n#### Chat Lifecycle Events\n```swift\nchatSession.onChatRehydrated = { event in\n    // Available properties:\n    // - event.id: Event ID (String)\n    // - event.timeStamp: When chat was rehydrated (String, ISO 8601)\n    // - event.participant: Participant role, e.g. \"AGENT\", \"CUSTOMER\" (String?)\n    // - event.displayName: Participant's display name (String?)\n    // - event.contentType: \"application/vnd.amazonaws.connect.event.chat.rehydrated\"\n    // - event.eventDirection: .Common\n    // - event.serializedContent: Additional rehydration data\n}\n```\n\n**Important Note**: Receipt events (`onReadReceipt`, `onDeliveredReceipt`) use `event.participant` for the participant ID (UUID format like `\"2171b970-42b8-471b-b999-3dee14efcd24\"`), while other events use it for the participant role (`\"AGENT\"`, `\"CUSTOMER\"`, etc.).\n\n## Advanced Configuration\n\n### Custom Client Implementation\n\nThe Amazon Connect Chat SDK for iOS supports custom client implementations to enable advanced networking scenarios such as:\n\n- **Custom endpoint routing** through proxy servers or API gateways\n- **Custom header injection** for authentication tokens, WAF bypass, or security headers  \n- **Certificate pinning** for enhanced security in enterprise environments\n- **Request/response transformation** for compliance or monitoring requirements\n\n#### Overview\n\nBy default, the SDK uses the standard AWS SDK HTTP client to communicate directly with Amazon Connect Participant Service APIs. For organizations requiring custom networking behavior, the SDK provides an inheritance-based system that allows you to subclass `AWSClient` and selectively override only the methods you need.\n\n**Flexible Override Options**: You can choose to override all ACPS API methods for complete control, or override only specific methods while automatically inheriting default behavior for the rest.\n\n#### Implementation Steps\n\n**1. Subclass AWSClient**\n\nCreate a custom client class that inherits from `AWSClient` and override the methods you need:\n\n**Option A: Partial Override**\n```swift\nimport AmazonConnectChatIOS\nimport AWSConnectParticipant\n\nclass MyCustomClient: AWSClient {\n    \n    // Only override the methods you need to customize\n    override func createParticipantConnection(participantToken: String, completion: @escaping (Result\u003cConnectionDetails, Error\u003e) -\u003e Void) {\n        // Add custom logging/monitoring\n        print(\"Custom client: Routing createParticipantConnection through proxy\")\n        \n        // Call parent implementation to use default AWS behavior\n        super.createParticipantConnection(participantToken: participantToken, completion: completion)\n    }\n    \n    override func sendMessage(connectionToken: String, contentType: ContentType, message: String, completion: @escaping (Result\u003cAWSConnectParticipantSendMessageResponse, Error\u003e) -\u003e Void) {\n        // Add custom message filtering or transformation\n        let filteredMessage = applyCustomFilters(message)\n        \n        // Call parent implementation with modified message\n        super.sendMessage(connectionToken: connectionToken, contentType: contentType, message: filteredMessage, completion: completion)\n    }\n    \n    // Other methods automatically use parent AWSClient implementation\n    // No need to implement them unless you need custom behavior\n}\n```\n\n**Option B: Complete Override (For full control)**\n```swift\nclass MyFullCustomClient: AWSClient {\n    \n    // Override ALL ACPS methods with completely custom implementations\n    override func createParticipantConnection(participantToken: String, completion: @escaping (Result\u003cConnectionDetails, Error\u003e) -\u003e Void) {\n        // Completely custom implementation - route through your proxy\n        let customRequest = buildCustomRequest(\n            endpoint: \"https://your-proxy.example.com/participant-connection\",\n            token: participantToken\n        )\n        executeRequest(customRequest) { result in\n            completion(result)\n        }\n    }\n    \n    override func sendMessage(connectionToken: String, contentType: ContentType, message: String, completion: @escaping (Result\u003cAWSConnectParticipantSendMessageResponse, Error\u003e) -\u003e Void) {\n        // Completely custom message routing\n    }\n    \n    override func sendEvent(connectionToken: String, contentType: ContentType, content: String, completion: @escaping (Result\u003cAWSConnectParticipantSendEventResponse, Error\u003e) -\u003e Void) {\n        // Completely custom event routing\n    }\n    \n    override func getTranscript(getTranscriptArgs: AWSConnectParticipantGetTranscriptRequest, completion: @escaping (Result\u003cAWSConnectParticipantGetTranscriptResponse, Error\u003e) -\u003e Void) {\n        // Completely custom transcript retrieval\n    }\n    \n    override func disconnectParticipantConnection(connectionToken: String, completion: @escaping (Result\u003cAWSConnectParticipantDisconnectParticipantResponse, Error\u003e) -\u003e Void) {\n        // Completely custom disconnect\n    }\n    \n    override func startAttachmentUpload(connectionToken: String, contentType: String, attachmentName: String, attachmentSizeInBytes: Int, completion: @escaping (Result\u003cAWSConnectParticipantStartAttachmentUploadResponse, Error\u003e) -\u003e Void) {\n        // Completely custom attachment upload start\n    }\n    \n    override func completeAttachmentUpload(connectionToken: String, attachmentIds: [String], completion: @escaping (Result\u003cAWSConnectParticipantCompleteAttachmentUploadResponse, Error\u003e) -\u003e Void) {\n        // Completely custom attachment upload completion\n    }\n    \n    override func getAttachment(connectionToken: String, attachmentId: String, completion: @escaping (Result\u003cAWSConnectParticipantGetAttachmentResponse, Error\u003e) -\u003e Void) {\n        // Completely custom attachment download\n    }\n}\n```\n\n**2. Configure ChatSession with Custom Client**\n\nInject your custom client into the ChatSession via GlobalConfig:\n\n```swift\nimport AmazonConnectChatIOS\n\nclass ChatManager: ObservableObject {\n    private var chatSession = ChatSession.shared\n    private let customClient = MyCustomClient()\n    \n    init() {\n        // Configure with custom client\n        let globalConfig = GlobalConfig(\n            region: .USEast1,\n            customAWSClient: customClient\n        )\n        chatSession.configure(config: globalConfig)\n    }\n}\n```\n\n**3. Available Override Methods**\n\nYour custom client can override any or all of these ACPS methods from the `AWSClient` base class:\n\n| Method | Purpose | Required Parameters |\n|--------|---------|-------------------|\n| `createParticipantConnection` | Establish chat session | `participantToken` |\n| `sendMessage` | Send chat messages | `connectionToken`, `contentType`, `message` |\n| `sendEvent` | Send typing indicators and events | `connectionToken`, `contentType`, `content` |\n| `getTranscript` | Retrieve chat history | `getTranscriptArgs` |\n| `disconnectParticipantConnection` | End chat session | `connectionToken` |\n| `startAttachmentUpload` | Initiate file uploads | `connectionToken`, `contentType`, `attachmentName`, `attachmentSizeInBytes` |\n| `completeAttachmentUpload` | Complete file uploads | `connectionToken`, `attachmentIds` |\n| `getAttachment` | Download attachments | `connectionToken`, `attachmentId` |\n\n#### Use Cases\n\n**Enterprise Proxy Routing**\n```swift\n// Route all API calls through corporate proxy\nfunc createParticipantConnection(participantToken: String, completion: @escaping (Result\u003cConnectionDetails, Error\u003e) -\u003e Void) {\n    let proxyURL = \"https://corporate-proxy.company.com/connect-participant\"\n    let request = URLRequest(url: URL(string: proxyURL)!)\n    // Add corporate authentication headers\n    request.setValue(\"Bearer \\(corporateToken)\", forHTTPHeaderField: \"Authorization\")\n    // Execute request through proxy\n}\n```\n\n**WAF Token Injection**\n```swift\n// Add WAF bypass tokens to all requests\nfunc sendMessage(connectionToken: String, contentType: ContentType, message: String, completion: @escaping (Result\u003cAWSConnectParticipantSendMessageResponse, Error\u003e) -\u003e Void) {\n    var request = buildStandardRequest(connectionToken, contentType, message)\n    // Inject WAF token\n    request.setValue(wafToken, forHTTPHeaderField: \"X-WAF-Token\")\n    executeRequest(request, completion: completion)\n}\n```\n\n**Certificate Pinning**\n```swift\nclass SecureCustomClient: AWSClient, URLSessionDelegate {\n    \n    func urlSession(_ session: URLSession, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -\u003e Void) {\n        // Implement certificate pinning validation\n        if validateCertificatePinning(challenge.protectionSpace.serverTrust) {\n            completionHandler(.useCredential, URLCredential(trust: challenge.protectionSpace.serverTrust!))\n        } else {\n            completionHandler(.cancelAuthenticationChallenge, nil)\n        }\n    }\n}\n```\n\n#### Important Considerations\n\n- **Flexible Override**: You can override all ACPS methods for complete control, or selectively override only the methods you need. Non-overridden methods automatically use the parent `AWSClient` implementation.\n\n- **Backward Compatibility**: Custom client implementation is completely optional. Existing applications continue to work unchanged when not using a custom client.\n\n- **Calling Parent Methods**: You can call `super.methodName()` from your overridden methods to use the default AWS implementation while adding custom behavior (logging, monitoring, etc.).\n\n- **Full Responsibility for Overridden Methods**: When you override a method without calling `super`, your implementation becomes fully responsible for that API interaction including error handling, retries, authentication, and response parsing.\n\n- **Token Security**: The SDK treats participant tokens as opaque strings. Your custom client receives these tokens and is responsible for secure handling.\n\n- **Error Handling**: Implement proper error handling and retry logic in your custom client to ensure reliable chat functionality.\n\n- **Performance**: Custom clients should maintain low latency (\u003c100ms additional overhead recommended) to preserve real-time chat experience.\n\n- **Testing**: Thoroughly test your custom client implementation across all ACPS API methods and error scenarios.\n\n## API List\n\n### GlobalConfig\nThe `GlobalConfig` object is used to configure both the AWS ConnectParticipant client as well as some of the chat behavior.\n\n#### `GlobalConfig.init`\nThe initializer for the `GlobalConfig` object takes in the `AWSRegionType`, the enabled `Features` and `disableCSM` flag to disable metrics.\n\n```\npublic struct GlobalConfig {\n    public var region: AWSRegionType\n    public var features: Features\n    public var disableCsm: Bool\n\n    public static var defaultRegion: AWSRegionType {\n        return Constants.DEFAULT_REGION\n    }\n\n    // Initializes a new global configuration with optional custom settings or defaults\n    public init(region: AWSRegionType = defaultRegion, features: Features = .defaultFeatures, disableCsm: Bool = false) {\n        self.region = region\n        self.features = features\n        self.disableCsm = disableCsm\n    }\n}\n```\n* `region`\n  * This property is used to set the region of the ConnectParticipant client.  This should be set to the region of your Connect instance (e.g. `.USEast1`)\n  * Type: `AWSRegionType`\n* `features: Features`\n  * The features property dictates the enablement of certain features as well as their configurations. If no value is passed for this property, the chat will be configured with default values. See [Features](#features) for more details.\n  * Type: [Features](#features)\n \n#### Updating configuration\nIf you have set the `GlobalConfig` object or want to update the configurations, you can call `ChatSession.configure` to update the config object.\n\n```\nlet globalConfig = GlobalConfig(region: .USEast1)\nchatSession.configure(config: globalConfig)\n```\n\n### SDKLogger\nThe `SDKLogger` class is responsible for logging relevant runtime information to the console which is useful for debugging purposes. The `SDKLogger` will log key events such as establishing a connection or failures such as failing to send a message. By default, logging is disabled and can be enabled/disabled at runtime.\n\n#### Enabling/Disabling Logging\nYou can toggle logging on/off using the `isLoggingEnabled` flag:\n```swift\n// Enable logging\nSDKLogger.isLoggingEnabled = true\n\n// Disable logging\nSDKLogger.isLoggingEnabled = false\n```\n\n#### `SDKLogger.configure`\nThis API will allow you to override the SDK's built-in logger with your own [SDKLoggerProtocol](#sdkloggerprotocol) implementation. This is especially useful in cases where you would want to store logs for debugging purposes. Attaching these logs to issues filed in this project will greatly expedite the resolution process.\n\n```\npublic static func configureLogger(_ logger: SDKLoggerProtocol) {\n    SDKLogger.logger = logger\n}\n```\n\n#### SDKLoggerProtocol\nThe SDKLoggerProtocol is a protocol used for the `SDKLogger`.  Users can override the `SDKLogger` with any class that implements SDKLoggerProtocol.\n\n```\npublic protocol SDKLoggerProtocol {\n    func logVerbose(\n        _ message: @autoclosure () -\u003e String\n    )\n    func logInfo(\n        _ message: @autoclosure () -\u003e String\n    )\n    func logDebug(\n        _ message: @autoclosure () -\u003e String\n    )\n    func logFault(\n        _ message: @autoclosure () -\u003e String\n    )\n    func logError(\n        _ message: @autoclosure () -\u003e String\n    )\n}\n```\n\n--------------------\n\n### ChatSession APIs\n\n#### `ChatSession.configure`\nConfigures the chat service with a `GlobalConfiguration` object.\n\n```\nfunc configure(config: GlobalConfig)\n```\n* `config`\n  * The global configuration to use\n  * Type: [GlobalConfig](#globalconfig)\n\n--------------------\n\n#### `ChatSession.getConnectionDetailsProvider`\nReturns a `ConnectionDetailsProvider` object that includes connection details.\n\n```\nfun getConnectionDetailsProvider(): ConnectionDetailsProvider\n```\n* Return type: [ConnectionDetailsProvider](#connectiondetailsprovider)\n\n--------------------\n\n#### `ChatSession.connect`\nAttempts to connect to a chat session with the given details.\n\n```\nfunc connect(chatDetails: ChatDetails, completion: @escaping (Result\u003cVoid, Error\u003e) -\u003e Void)\n\npublic struct ChatDetails {\n    var contactId: String?\n    var participantId: String?\n    var participantToken: String\n}\n```\n\n* `chatDetails`\n  * The details of the chat session to connect to. `ChatDetails` data is extracted from `StartChatContact` response.\n  * Type: `ChatDetails`\n* `completion`\n  * The completion handler to call when the connect operation is complete.\n  * Type: `(Result\u003cVoid, Error\u003e) -\u003e Void`\n\n--------------------\n\n#### `ChatSession.disconnect`\nDisconnects the current chat session.\n\n```\nfunc disconnect(completion: @escaping (Result\u003cVoid, Error\u003e) -\u003e Void)\n```\n\n* `completion`\n  * The completion handler to call when the disconnect operation is complete.\n  * Type: `(Result\u003cVoid, Error\u003e) -\u003e Void`\n\n--------------------\n\n#### `ChatSession.reset`\nResets the ChatSession object which will disconnect the webSocket and remove all session related data without disconnecting the participant from the chat contact.\n\n```\nfunc reset()\n```\n\n--------------------\n\n#### `ChatSession.suspendWebSocketConnection`\nDisconnects the websocket and suspends reconnection attempts.\n\n```\nfunc suspendWebSocketConnection()\n```\n\n--------------------\n\n#### `ChatSession.resumeWebSocketConnection`\nResumes a suspended websocket and attempts to reconnect.\n```\nfunc resumeWebSocketConnection()\n```\n\n--------------------\n\n#### `ChatSession.sendMessage`\nSends a message within the chat session.\n\n```\nfunc sendMessage(contentType: ContentType, message: String, completion: @escaping (Result\u003cVoid, Error\u003e) -\u003e Void)\n```\n\n* `contentType`\n  * The type of the message content.\n  * Type: [ContentType](#contenttype)\n* `message`\n  * The message to send.\n  * Type: `String`\n* `completion`\n  * The completion handler to call when the send operation is complete.\n  * Type: `(Result\u003cVoid, Error\u003e) -\u003e Void`\n\n\n--------------------\n\n#### `ChatSession.sendEvent`\nSends an event within the chat session.\n\n```\nfunc sendEvent(event: ContentType, content: String, completion: @escaping (Result\u003cVoid, Error\u003e) -\u003e Void)\n```\n\n* `event`\n  * The type of the event content.\n  * Type: [ContentType](#contenttype)\n* `content`\n  * The event content to send.\n  * Type: `String`\n* `completion`\n  * The completion handler to call when the send operation is complete.\n  * Type: `(Result\u003cVoid, Error\u003e) -\u003e Void`\n\n\n--------------------\n\n#### `ChatSession.sendMessageReceipt`\nSends read receipt for a message.\n\n```\nfunc sendMessageReceipt(event: MessageReceiptType, messageId: String, completion: @escaping (Result\u003cVoid, Error\u003e) -\u003e Void)\n```\n\n* `event`\n  * The type of read receipt to send (either `.messageDelivered` or `.messageRead`\n  * Type: [MessageReceiptType](#messagereceipttype)\n  * Default: `.messageRead`\n* `messageId`\n  * The ID of the message to acknowledge.\n  * Type: `String`    \n* `completion`\n  * The completion handler to call when the send operation is complete.\n  * Type: `(Result\u003cVoid, Error\u003e) -\u003e Void`\n\n\n--------------------\n\n#### `ChatSession.getTranscript`\nRetrieves the chat transcript.\n\n```\nfunc getTranscript(scanDirection: AWSConnectParticipantScanDirection?, sortOrder: AWSConnectParticipantSortKey?, maxResults: NSNumber?, nextToken: String?, startPosition: AWSConnectParticipantStartPosition?, completion: @escaping (Result\u003cTranscriptResponse, Error\u003e) -\u003e Void)\n```\n\n* `scanDirection`\n  * The direction to scan the transcript.\n  * Type: `AWSConnectParticipantScanDirection?` (String: `'FORWARD' | 'BACKWARD'`) \n  * Default: `BACKWARD`\n* `sortOrder`\n  * The order to sort the transcript.\n  * Type: `AWSConnectParticipantSortKey?` (String: `'DESCENDING | 'ASCENDING'`)\n  * Default: `ASCENDING`\n* `maxResults`\n  * The maximum number of results to retrieve.\n  * Type: `NSNumber?`\n  * Default: `15`\n* `nextToken`\n  * Type: `String`\n  * The token for the next set of results.\n* `startPosition`\n  * The start position for the transcript.\n  * Type: `AWSConnectParticipantStartPosition?`. See [StartPosition](https://docs.aws.amazon.com/connect/latest/APIReference/API_connect-participant_StartPosition.html)\n* `completion`\n  * The completion handler to call when the transcript retrieval is complete.\n  * Type: (Result\u003c[TranscriptResponse](#transcriptresponse), Error\u003e) -\u003e Void\n\n--------------------\n\n#### `ChatSession.sendAttachment`\nSends an attachment within the chat session.\n\n```\nfunc sendAttachment(file: URL, completion: @escaping (Result\u003cVoid, Error\u003e) -\u003e Void)\n```\n\n* `file`\n  * The URL of the file to attach.\n  * Type: `URL`\n* `completion`\n  * The completion handler to call when the send operation is complete.\n  * Type: `(Result\u003cVoid, Error\u003e) -\u003e Void`\n\n--------------------\n\n#### `ChatSession.downloadAttachment`\nDownloads an attachment to the app's temporary directory given an attachment ID.\n\n```\nfunc downloadAttachment(attachmentId: String, filename: String, completion: @escaping (Result\u003cURL, Error\u003e) -\u003e Void)\n```\n\n* `attachmentId`\n  * The ID of the attachment to download.\n  * Type: `String`\n* `filename`\n  * The name of the file to save the attachment as.\n  * Type: `String`\n* `completion`\n  * The completion handler to call when the download operation is complete.\n  * Type: `(Result\u003cURL, Error\u003e) -\u003e Void`\n\n--------------------\n\n#### `ChatSession.getAttachmentDownloadUrl`\nReturns the download URL link for the given attachment ID.\n\n```\nfunc getAttachmentDownloadUrl(attachmentId: String, completion: @escaping (Result\u003cURL, Error\u003e) -\u003e Void)\n```\n\n* `attachmentId`\n  * The ID of the attachment.\n  * Type: `String`\n* `completion`\n  * The completion handler to call when the URL retrieval is complete.\n  * Type: `(Result\u003cURL, Error\u003e) -\u003e Void`\n\n--------------------\n\n\n#### `ChatSession.resendFailedMessage`\nRetry a text message or attachment that failed to be sent.\n\n```\nfunc resendFailedMessage(messageId: String, completion: @escaping (Result\u003cVoid, Error\u003e) -\u003e Void)\n```\n\n* `messageId`\n  * messageId The Id of the message that failed to be sent.\n  * Type: `String`\n  \n--------------------\n\n#### `ChatSession.isChatSessionActive`\nReturns a boolean indicating whether the chat session is still active.\n\n```\nfunc isChatSessionActive() -\u003e Bool\n```\n\n--------------------\n\n### ChatSession Events\n\n#### `ChatSession.onConnectionEstablished`\nCallback for when the connection is established.\n\n```\nvar onConnectionEstablished: (() -\u003e Void)? { get set }\n```\n\n--------------------\n\n#### `ChatSession.onConnectionBroken`\nCallback for when the connection is broken.\n\n```\nvar onConnectionBroken: (() -\u003e Void)? { get set }\n```\n\n--------------------\n\n#### `ChatSession.onMessageReceived`\nCallback for when a WebSocket message is received. See [TranscriptItem](#transcriptitem).\n\n```\nvar onMessageReceived: ((TranscriptItem) -\u003e Void)? { get set }\n```\n--------------------\n\n#### `ChatSession.onTranscriptUpdated`\nCallback for when the transcript is updated. See [TranscriptData](#transcriptdata)\n\n```\nvar onTranscriptUpdated: ((TranscriptData) -\u003e Void)? { get set }\n```\n\n--------------------\n\n#### `ChatSession.onChatEnded`\nCallback for when the chat ends.\n\n```\nvar onChatEnded: (() -\u003e Void)? { get set }\n```\n--------------------\n\n#### `ChatSession.onDeepHeartbeatFailure`\nCallback for when the WebSocket heartbeat is missed.\n\n```\nvar onDeepHeartbeatFailure: (() -\u003e Void)? { get set }\n```\n--------------------\n#### `ChatSession.onConnectionReEstablished`\nCallback for when the connection is re-established.\n\n```\nvar onConnectionReEstablished: (() -\u003e Void)? { get set }\n```\n--------------------\n\n#### `ChatSession.onParticipantIdle`\nCallback for when a participant becomes idle.\n\n```\nvar onParticipantIdle: ((Event) -\u003e Void)? { get set }\n```\n\n--------------------\n\n#### `ChatSession.onParticipantReturned`\nCallback for when a participant returns from idle state.\n\n```\nvar onParticipantReturned: ((Event) -\u003e Void)? { get set }\n```\n\n--------------------\n\n#### `ChatSession.onAutoDisconnection`\nCallback for when a participant is automatically disconnected due to inactivity.\n\n```\nvar onAutoDisconnection: ((Event) -\u003e Void)? { get set }\n```\n\n--------------------\n\n#### `ChatSession.onTyping`\nCallback for when a participant is typing.\n\n```\nvar onTyping: ((Event) -\u003e Void)? { get set }\n```\n\n--------------------\n\n#### `ChatSession.onReadReceipt`\nCallback for when a message read receipt is received.\n\n```\nvar onReadReceipt: ((Event) -\u003e Void)? { get set }\n```\n\n--------------------\n\n#### `ChatSession.onDeliveredReceipt`\nCallback for when a message delivered receipt is received.\n\n```\nvar onDeliveredReceipt: ((Event) -\u003e Void)? { get set }\n```\n\n--------------------\n\n#### `ChatSession.onParticipantInvited`\nCallback for when a participant is invited to the chat.\n\n```\nvar onParticipantInvited: ((Event) -\u003e Void)? { get set }\n```\n\n--------------------\n\n#### `ChatSession.onChatRehydrated`\nCallback for when a chat session is rehydrated (restored from a previous session).\n\n```\nvar onChatRehydrated: ((Event) -\u003e Void)? { get set }\n```\n\n--------------------\n\n## Classes and Structs\n\n### Features\nFeatures are a list of optional chat functions that users may choose to enable, disable or reconfigure.\n\n```\npublic struct Features {\n    public var messageReceipts: MessageReceipts\n\n    // Provides default Features configuration\n    public static var defaultFeatures: Features {\n        return Features(messageReceipts: .defaultReceipts)\n    }\n\n    public init(messageReceipts: MessageReceipts = .defaultReceipts) {\n        self.messageReceipts = messageReceipts\n    }\n}\n```\n\nthe default value for `Features` will contain the default values for all containing features.\n\n--------------------\n\n### Message Receipts\nThis feature enables the use of `Read` and `Delivered` receipts for messages. This is used to indicate whether agents have read texts that the client has sent and vice versa.\n\n```\npublic struct MessageReceipts {\n    public var shouldSendMessageReceipts: Bool\n    public var throttleTime: Double\n    \n    // Provides default MessageReceipts configuration\n    public static var defaultReceipts: MessageReceipts {\n        return MessageReceipts(shouldSendMessageReceipts: true, throttleTime: Constants.MESSAGE_RECEIPT_THROTTLE_TIME)\n    }\n    \n    public init(shouldSendMessageReceipts: Bool, throttleTime: Double) {\n        self.shouldSendMessageReceipts = shouldSendMessageReceipts\n        self.throttleTime = throttleTime\n    }\n}\n```\n* `shouldSendMessageReceipts`\n  * Type: `Bool`\n  * This is the flag that dictates whether message receipts will be sent from the client side.  Note that this will not block message receipt events from being sent from the agent.\n  * Default: `true`\n* `throttleTime`\n  * Type: `Double`\n  * This is used to determine how long to throttle message receipt events before firing them. We recommend having at least some throttling time before each event to reduce unecessary network requests\n  * Default: `5.0`\n\n--------------------\n### ChatDetails\n\n```\npublic struct ChatDetails {\n    var contactId: String?\n    var participantId: String?\n    var participantToken: String\n}\n```\n* `contactId`\n  * Contact identifier received via [StartChatContact](https://docs.aws.amazon.com/connect/latest/APIReference/API_StartChatContact.html) response\n  * Type: `String`\n* `particpantId`\n  * Participant identifier received via [StartChatContact](https://docs.aws.amazon.com/connect/latest/APIReference/API_StartChatContact.html) response\n  * Type: `String`\n* `participantToken`\n  * Participant token received via [StartChatContact](https://docs.aws.amazon.com/connect/latest/APIReference/API_StartChatContact.html) response\n  * Type: `String`\n  \n---------------------\n### ConnectionDetailsProvider\n\n```\npublic protocol ConnectionDetailsProviderProtocol {\n    func updateChatDetails(newDetails: ChatDetails)\n    func getConnectionDetails() -\u003e ConnectionDetails?\n    func updateConnectionDetails(newDetails: ConnectionDetails)\n    func getChatDetails() -\u003e ChatDetails?\n    func isChatSessionActive() -\u003e Bool\n    func setChatSessionState(isActive: Bool) -\u003e Void\n}\n```\n* `updateChatDetails`\n  * Updates chat details\n  * newDetails\n    * Type: `ChatDetails`\n* `getConnectionDetails`\n  * Gets connection details received via [CreateParticipantConnection](https://docs.aws.amazon.com/connect/latest/APIReference/API_connect-participant_CreateParticipantConnection.html) response\n  * Return type: [ConnectionDetails](#connectiondetails)\n* `updateConnectionDetails`\n  * Updates connection details \n  * newDetails\n    * Type: [ConnectionDetails](#connectiondetails)\n* `getChatDetails`\n  * Gets chat details\n  * Return type: `ChatDetails`\n* `isChatSessionActive`\n  * Gets chat session active state\n  * Return type: Boolean\n* `setChatSessionState`\n  * Sets chat session state\n  * isActive\n    * Type: Boolean\n\n---------------------\n\n### ConnectionDetails\n\n```\npublic struct ConnectionDetails {\n    public func getWebsocketUrl() -\u003e String?\n    public func getConnectionToken() -\u003e String?\n    public func getExpiry() -\u003e Date?\n}\n```\n* `getWebsocketUrl`\n  * Returns URL of the websocket received via [CreateParticipantConnection](https://docs.aws.amazon.com/connect/latest/APIReference/API_connect-participant_CreateParticipantConnection.html) response\n  * Return type: `String`\n* `getConnectionToken`\n  * Returns connection token received via [CreateParticipantConnection](https://docs.aws.amazon.com/connect/latest/APIReference/API_connect-participant_CreateParticipantConnection.html) response\n  * Return type: `String`\n* `getExpiry`\n  * Returns expiration of the token received via [CreateParticipantConnection](https://docs.aws.amazon.com/connect/latest/APIReference/API_connect-participant_CreateParticipantConnection.html) response\n  * Return type: `Date`\n\n---------------------\n### ContentType\n\n`ContentType` describe the type of events and messages that come through the WebSocket.\n\n```\npublic enum ContentType: String {\n    case typing = \"application/vnd.amazonaws.connect.event.typing\"\n    case connectionAcknowledged = \"application/vnd.amazonaws.connect.event.connection.acknowledged\"\n    case messageDelivered = \"application/vnd.amazonaws.connect.event.message.delivered\"\n    case messageRead = \"application/vnd.amazonaws.connect.event.message.read\"\n    case metaData = \"application/vnd.amazonaws.connect.event.message.metadata\"\n    case joined = \"application/vnd.amazonaws.connect.event.participant.joined\"\n    case left = \"application/vnd.amazonaws.connect.event.participant.left\"\n    case ended = \"application/vnd.amazonaws.connect.event.chat.ended\"\n    case participantIdle = \"application/vnd.amazonaws.connect.event.participant.idle\"\n    case participantReturned = \"application/vnd.amazonaws.connect.event.participant.returned\"\n    case participantInvited = \"application/vnd.amazonaws.connect.event.participant.invited\"\n    case autoDisconnection = \"application/vnd.amazonaws.connect.event.participant.autodisconnection\"\n    case participantDisplayNameUpdated = \"application/vnd.amazonaws.connect.event.participant.displayname.updated\"\n    case chatRehydrated = \"application/vnd.amazonaws.connect.event.chat.rehydrated\"\n    case plainText = \"text/plain\"\n    case richText = \"text/markdown\"\n    case interactiveText = \"application/vnd.amazonaws.connect.message.interactive\"\n}\n```\n--------------------\n### MessageReceiptType\n\n`MessageReceiptType` is a subset of [ContentType](#contenttype) for message receipt related events.\n\n```\npublic enum MessageReceiptType: String {\n    case messageDelivered = \"application/vnd.amazonaws.connect.event.message.delivered\"\n    case messageRead = \"application/vnd.amazonaws.connect.event.message.read\"\n}\n```\n--------------------\n### TranscriptResponse\n\n```\npublic class TranscriptResponse: Equatable {\n    public let initialContactId: String\n    public let nextToken: String\n    public var transcript: [TranscriptItem]\n}\n```\n* `initialContactId`\n  * This is the id of the chat contact\n  * Type: `String`\n* `nextToken`\n  * The `nextToken` is used to retrieve the next batch of messages from the server. This can be passed into [ChatSession.getTranscript](#chatsessiongettranscript)\n  * Type: `String`\n* `transcript`\n  * This contains the messages that were loaded\n  * Type: Array of [TranscriptItem](#transcriptitem)\n-------------------\n### TranscriptItem\nThis is the base class for all renderable messages in the transcript.\n\n```\npublic class TranscriptItem: TranscriptItemProtocol {\n    public var id: String\n    public var timeStamp: String\n    public var contentType: String\n    public var serializedContent: [String: Any]?\n    public var persistentId: String\n}\n```\n* `id`\n  * Id for the message. Unique to each message in the transcript. Id can be used only for the ACPS APIs requests.\n  * Type: `String`\n* `timeStamp`\n  * Time when the message or event was sent. Formatted in ISO 8601 (e.g. `yyyy-MM-ddThh:mm:ss.SSSZ` or ` 2019-11-08T02:41:28.172Z`)\n  * Type: `String`\n* `contentType`\n  * The type of message\n  * Type: `String` (See [ContentType](#contenttype)\n* `serializedContent`\n  * The raw JSON format of the received WebSocket message\n  * Type: Array of `String: Any`\n* `persistentId`\n  * Id for the message, Unique to each message throughout chat session. This can be used only for tracking purposes by the client.\n  * Type: `String`\n\n--------\n### TranscriptData\nThis is the object that is passed back to the registered [ChatSession.onTranscriptUpdated](#chatsessionontranscriptupdated) event handler\n\n```\npublic struct TranscriptData {\n    public let transcriptList: [TranscriptItem]\n    public let previousTranscriptNextToken: String?\n}\n```\n* `transcriptList`\n  * The current in-memory transcript list.\n  * Type: Array of `TranscriptItem`\n* `previousTranscriptNextToken`\n  * This is a next token that is used as a `getTranscript` argument to retrieve older messages.  This will be `nil` if there are no more available messages to fetch from the top of the currently loaded transcript.\n  * Type: `String`\n\n--------\n### Message (extends [TranscriptItem](#transcriptitem))\n\nThe Message type of TranscriptItem is reserved for all messages sent by bots, contact flow or other participants.  This includes interactive messages, attachments and plain text messages.\n\n```\npublic class Message: TranscriptItem, MessageProtocol {\n    public var participant: String\n    public var text: String\n    public var messageDirection: MessageDirection?\n    public var attachmentId: String?\n    public var displayName: String?\n    @Published public var metadata: (any MetadataProtocol)?\n}\n```\n* `participant`\n  * This is the participant role of the message sender (e.g. `AGENT`)\n  * Type: `String`\n* `text`\n  * This is the text content of the message\n  * Type: `String`\n* `messageDirection`\n  * This is the direction of the message\n  * Type: `MessageDirection` (`Outgoing | Incoming | Common`)\n* `attachmentId`\n  * This is the id of the attachment.  Only defined if this message contains an attachment.\n  * Type: `String`\n* `displayName`\n  * This is the display name of the message\n  * Type: `String`\n* `metadata`\n  * This is the metadata associated with the message.\n  * Type: [Metadata](#metadata)\n---\n### Event (extends [TranscriptItem](#transcriptitem))\nThe Event type of the TranscriptItem is for events that come through the WebSocket.  See [ContentType](#contenttype) for a list of possible events.\n\n```\npublic class Event: TranscriptItem, EventProtocol {\n    public var participant: String?\n    public var text: String?\n    public var displayName: String?\n    public var eventDirection: MessageDirection?\n}\n```\n* `participant`\n  * This is the participant role of the message sender (e.g. `AGENT`)\n  * Type: `String?`\n* `text`\n  * This is the text content of the event\n  * Type: `String?`\n* `displayName`\n  * This is the display name of the event\n  * Type: `String`\n* `eventDirection`\n  * This is the direction of the event\n  * Type: `eventDirection` (`Outgoing | Incoming | Common`)\n\n--------\n### Metadata (extends [TranscriptItem](#transcriptitem))\nThe Metadata event is used to receive additional data on a given message such as message receipt status.\n\n```\npublic class Metadata: TranscriptItem, MetadataProtocol {\n    @Published public var status: MessageStatus?\n    @Published public var eventDirection: MessageDirection?\n```\n* `status`\n  * This is the receipt status for the event.\n  * Type: `MessageStatus` (`'Read' | 'Delivered'`)\n* `eventDirection`\n  * This is the direction of the metadata event.\n  * Type: `eventDirection` (`Outgoing | Incoming | Common`)\n\n## Security\n\nSee [CONTRIBUTING](CONTRIBUTING.md#security-issue-notifications) for more information.\n\n## License\n\nThis project is licensed under the Apache-2.0 License.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famazon-connect%2Famazon-connect-chat-ios","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famazon-connect%2Famazon-connect-chat-ios","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famazon-connect%2Famazon-connect-chat-ios/lists"}