Skip to content

Commit

Permalink
Added support for rehydration event (#217)
Browse files Browse the repository at this point in the history
* Added support for rehydration event

* updated package lock file

* bumped chatjs version

* Update README.md with chat rehydration
  • Loading branch information
mrajatttt authored Jun 20, 2024
1 parent 517702e commit a48df0c
Show file tree
Hide file tree
Showing 7 changed files with 7,315 additions and 5,299 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.2.5]
### Added
- Added new callback onChatRehydrted callbacks whenever websocket fires `.rehydrated` event.

## [2.2.4]
### Fixed
- onDeepHeartBeatFailure is undefined, updated websocketManager library file to fix the bug.
Expand Down
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -711,6 +711,27 @@ chatSession.onDeepHeartbeatFailure(event => {

Subscribes an event handler that triggers when deep heartbeat fails.

##### `chatSession.onChatRehydrated()`
**Note**: Only when persistent chat is enabled.
```js
/**
* Subscribes an event handler that triggers whenever a "application/vnd.amazonaws.connect.event.chat.rehydrated" event is fired.
* @param {
AbsoluteTime?: string,
ContentType?: string,
Type?: string,
ParticipantId?: string,
DisplayName?: string,
ParticipantRole?: string,
InitialContactId?: string
} event.data
*/
chatSession.onChatRehydrated(event => {
const { chatDetails, data } = event;
// Load previous transcript...
});
```

#### Client side metric

In version `1.2.0` the client side metric(CSM) service is added into this library. Client side metric can provide insights into the real performance and usability, it helps us to understand how customers are actually using the website and what UI experiences they prefer. This feature is enabled by default. User can also disable this feature by passing a flag: `disableCSM` when they create a new chat session:
Expand Down
Loading

0 comments on commit a48df0c

Please sign in to comment.