-
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: support jwt token for zendesk auth (#57)
Update init function to accept externalId and jwt token for user authentication. This allows the conversation's requester to assign to a valid zendesk user instead of a generic web user. Additionally, added support to handle refreshing jwt token via `onInvalidAuth` function. Also caught a bug in init function, which returns a Thenable object, instead of an actual Promise, meaning the async/await syntax wouldn't actually catch any errors. Updated to use then/catch function from the returned Thenable object. J=CLIP-1622 TEST=manual created JWT tokens using test key/secret from prod zendesk and uses my zendesk user's externalId. Verified that I can start zendesk messaging with an agent and the ticket requester is assigned to the expected zendesk user instead of a random generated web user ID. verified that JWT token refresh handling also work. Also published an alpha version (0.2.0-alpha.2) to use in alpha, spin up storm, and verified I can start a conversation through advisor with the proper requester field assigned.
- Loading branch information
Showing
16 changed files
with
142 additions
and
39 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -194,7 +194,7 @@ The following NPM packages may be included in this product: | |
- @types/[email protected] | ||
- @types/[email protected] | ||
- @types/[email protected] | ||
- @types/node@22.9.1 | ||
- @types/node@22.10.1 | ||
- @types/[email protected] | ||
- @types/[email protected] | ||
- @types/[email protected] | ||
|
@@ -1826,7 +1826,7 @@ SOFTWARE. | |
|
||
The following NPM package may be included in this product: | ||
|
||
- [email protected].13 | ||
- [email protected].16 | ||
|
||
This package contains the following license and notice below: | ||
|
||
|
@@ -1939,7 +1939,7 @@ THE SOFTWARE. | |
|
||
The following NPM package may be included in this product: | ||
|
||
- psl@1.12.0 | ||
- psl@1.15.0 | ||
|
||
This package contains the following license and notice below: | ||
|
||
|
@@ -2629,7 +2629,7 @@ THE SOFTWARE. | |
|
||
The following NPM package may be included in this product: | ||
|
||
- undici-types@6.19.8 | ||
- undici-types@6.20.0 | ||
|
||
This package contains the following license and notice below: | ||
|
||
|
18 changes: 18 additions & 0 deletions
18
...es/chat-core-zendesk/docs/chat-core-zendesk.chatcorezendeskconfig.externalid.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,18 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@yext/chat-core-zendesk](./chat-core-zendesk.md) > [ChatCoreZendeskConfig](./chat-core-zendesk.chatcorezendeskconfig.md) > [externalId](./chat-core-zendesk.chatcorezendeskconfig.externalid.md) | ||
|
||
## ChatCoreZendeskConfig.externalId property | ||
|
||
The external ID to associate with the user in Zendesk. | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
externalId?: string; | ||
``` | ||
|
||
## Remarks | ||
|
||
Should be provided along with the [ChatCoreZendeskConfig.jwt](./chat-core-zendesk.chatcorezendeskconfig.jwt.md) token to authenticate the user. | ||
|
18 changes: 18 additions & 0 deletions
18
packages/chat-core-zendesk/docs/chat-core-zendesk.chatcorezendeskconfig.jwt.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,18 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@yext/chat-core-zendesk](./chat-core-zendesk.md) > [ChatCoreZendeskConfig](./chat-core-zendesk.chatcorezendeskconfig.md) > [jwt](./chat-core-zendesk.chatcorezendeskconfig.jwt.md) | ||
|
||
## ChatCoreZendeskConfig.jwt property | ||
|
||
The JWT token to authenticate the user with Zendesk. | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
jwt?: string; | ||
``` | ||
|
||
## Remarks | ||
|
||
Should be provided along with the [ChatCoreZendeskConfig.externalId](./chat-core-zendesk.chatcorezendeskconfig.externalid.md) to authenticate the user. | ||
|
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
13 changes: 13 additions & 0 deletions
13
...chat-core-zendesk/docs/chat-core-zendesk.chatcorezendeskconfig.oninvalidauth.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) > [ChatCoreZendeskConfig](./chat-core-zendesk.chatcorezendeskconfig.md) > [onInvalidAuth](./chat-core-zendesk.chatcorezendeskconfig.oninvalidauth.md) | ||
|
||
## ChatCoreZendeskConfig.onInvalidAuth property | ||
|
||
Callback to be invoked when the authentication token is invalid. The returned string will be used as the new auth token when retrying the request. | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
onInvalidAuth?: () => string | Promise<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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
TEST_BOT_ID= | ||
TEST_BOT_API_KEY= | ||
TEST_ZENDESK_INTEGRATION_ID= | ||
TEST_ZENDESK_INTEGRATION_ID= | ||
|
||
# agent handoff with zendesk user authentication | ||
TEST_EXTERNAL_ID= | ||
TEST_JWT= | ||
TEST_REFRESH_JWT= |
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