-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chat-core-zendesk: add support for session reinitialization (#53)
Adds support for restoring a Zendesk agent conversation using the conversation ID. Requires reinitialization of the Zendesk client, which can only be triggered on the first message sent after the new page is loaded. This leads to a slight bit of extra lag on that first message, but otherwise everything seems to work as if the page was never reloaded. TEST=manual Used this locally with upcoming chat-headless change to support this new method, saw expected results across page loads and within the Zendesk platform.
- Loading branch information
Showing
19 changed files
with
169 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -195,7 +195,7 @@ The following NPM packages may be included in this product: | |
- @types/[email protected] | ||
- @types/[email protected] | ||
- @types/[email protected] | ||
- @types/node@22.5.5 | ||
- @types/node@22.7.4 | ||
- @types/[email protected] | ||
- @types/[email protected] | ||
- @types/[email protected] | ||
|
@@ -1863,7 +1863,7 @@ SOFTWARE. | |
|
||
The following NPM package may be included in this product: | ||
|
||
- [email protected].12 | ||
- [email protected].13 | ||
|
||
This package contains the following license and notice below: | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
...ws-connect/docs/chat-core-aws-connect.chatcoreawsconnect.reinitializesession.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@yext/chat-core-aws-connect](./chat-core-aws-connect.md) > [ChatCoreAwsConnect](./chat-core-aws-connect.chatcoreawsconnect.md) > [reinitializeSession](./chat-core-aws-connect.chatcoreawsconnect.reinitializesession.md) | ||
|
||
## ChatCoreAwsConnect.reinitializeSession() method | ||
|
||
Reinitialize the session using existing session data. | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
reinitializeSession(_: unknown): Promise<void>; | ||
``` | ||
|
||
## Parameters | ||
|
||
| Parameter | Type | Description | | ||
| --- | --- | --- | | ||
| \_ | unknown | | | ||
|
||
**Returns:** | ||
|
||
Promise<void> | ||
|
||
## Remarks | ||
|
||
This is currently not supported for Amazon Connect. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
...chat-core-zendesk/docs/chat-core-zendesk.chatcorezendesk.reinitializesession.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@yext/chat-core-zendesk](./chat-core-zendesk.md) > [ChatCoreZendesk](./chat-core-zendesk.chatcorezendesk.md) > [reinitializeSession](./chat-core-zendesk.chatcorezendesk.reinitializesession.md) | ||
|
||
## ChatCoreZendesk.reinitializeSession() method | ||
|
||
Reinitialize the session using existing session data. | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
reinitializeSession(credentials: ChatCoreZendeskSessionCredentials): Promise<void>; | ||
``` | ||
|
||
## Parameters | ||
|
||
| Parameter | Type | Description | | ||
| --- | --- | --- | | ||
| credentials | [ChatCoreZendeskSessionCredentials](./chat-core-zendesk.chatcorezendesksessioncredentials.md) | The credentials to use to reinitialize the session. | | ||
|
||
**Returns:** | ||
|
||
Promise<void> | ||
|
13 changes: 13 additions & 0 deletions
13
...desk/docs/chat-core-zendesk.chatcorezendesksessioncredentials.conversationid.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@yext/chat-core-zendesk](./chat-core-zendesk.md) > [ChatCoreZendeskSessionCredentials](./chat-core-zendesk.chatcorezendesksessioncredentials.md) > [conversationId](./chat-core-zendesk.chatcorezendesksessioncredentials.conversationid.md) | ||
|
||
## ChatCoreZendeskSessionCredentials.conversationId property | ||
|
||
The conversation ID for the current chat session. | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
conversationId: string; | ||
``` |
20 changes: 20 additions & 0 deletions
20
...s/chat-core-zendesk/docs/chat-core-zendesk.chatcorezendesksessioncredentials.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@yext/chat-core-zendesk](./chat-core-zendesk.md) > [ChatCoreZendeskSessionCredentials](./chat-core-zendesk.chatcorezendesksessioncredentials.md) | ||
|
||
## ChatCoreZendeskSessionCredentials interface | ||
|
||
Credentials for the Zendesk session created by the [ChatCoreZendesk](./chat-core-zendesk.chatcorezendesk.md)<!-- -->. Used for reinitializing the session across page reloads. | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
export interface ChatCoreZendeskSessionCredentials | ||
``` | ||
|
||
## Properties | ||
|
||
| Property | Modifiers | Type | Description | | ||
| --- | --- | --- | --- | | ||
| [conversationId](./chat-core-zendesk.chatcorezendesksessioncredentials.conversationid.md) | | string | The conversation ID for the current chat session. | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
packages/chat-core-zendesk/src/models/ChatCoreZendeskSessionCredentials.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/** | ||
* Credentials for the Zendesk session created by the {@link ChatCoreZendesk}. | ||
* Used for reinitializing the session across page reloads. | ||
* | ||
* @public | ||
*/ | ||
export interface ChatCoreZendeskSessionCredentials { | ||
/** | ||
* The conversation ID for the current chat session. | ||
*/ | ||
conversationId: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export { ChatCoreZendeskConfig } from "./ChatCoreZendeskConfig"; | ||
export { ChatCoreZendesk } from "./ChatCoreZendesk"; | ||
export { ChatCoreZendeskSessionCredentials } from "./ChatCoreZendeskSessionCredentials"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters