Skip to content

Commit

Permalink
Document connect.core.getWebSocketManager() (#264)
Browse files Browse the repository at this point in the history
WHAT?

Document and add the typings for
`connect.core.getWebSocketManager()`.

WHY?

This method is required for creating an `amazon-connect-chatjs`'s
`AgentChatSession` object.
  • Loading branch information
marcogrcr authored Jun 26, 2020
1 parent 2b3342b commit f9242a0
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
14 changes: 13 additions & 1 deletion Documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,18 @@ connect.core.onAccessDenied(function() { /* ... */ });
```
Subscribes a callback that executes whenever authorization fails (i.e. access denied).

### `connect.core.getWebSocketManager()`
```js
// `connect.ChatSession` is defined by `amazon-connect-chatjs`
connect.ChatSession.create({
type: connect.ChatSession.SessionTypes.AGENT,
websocketManager: connect.core.getWebSocketManager()
// ...
});
```
Gets the `WebSocket` manager. This method is only used when integrating with `amazon-connect-chatjs`.
See the [amazon-connect-chatjs](https://github.com/amazon-connect/amazon-connect-chatjs) documentation for more information.

## Event Subscription
Event subscriptions link your app into the heartbeat of Amazon Connect by allowing your
code to be called when new agent information is available.
Expand Down Expand Up @@ -1087,7 +1099,7 @@ Returns the `MediaType` enum value: `"chat"`.
conn.getMediaController().then(function (chatController) { /* ... */ });
```
Gets a `Promise` with the media controller associated with this connection.
The promise resolves to a `ChatSession` object from `amazon-connect-chatjs` library.
The promise resolves to an `AgentChatSession` object from `amazon-connect-chatjs` library.
See the [amazon-connect-chatjs documentation](https://github.com/amazon-connect/amazon-connect-chatjs) for more information.

## Utility Functions
Expand Down
6 changes: 6 additions & 0 deletions src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,12 @@ declare namespace connect {
* @param callback A callback that will execute whenever access is denied.
*/
onAccessDenied(callback: SuccessFailCallback): void;

/**
* Gets the `WebSocket` manager.
* This method is only used when integrating with `amazon-connect-chatjs`.
*/
getWebSocketManager(): any;
}

const core: Core;
Expand Down

0 comments on commit f9242a0

Please sign in to comment.