@microsoft/omnichannel-chat-sdk
Advanced tools
Comparing version 0.1.1-main.3b3e3ff to 0.1.1-main.4b804ff
@@ -10,2 +10,3 @@ # Changelog | ||
- Expose `sessiontInit`'s `initContext` on `startChat`'s optional paramaters | ||
- Add ability to use custom `ic3Config` & `chatAdapterConfig` | ||
@@ -12,0 +13,0 @@ ### Changed |
@@ -0,1 +1,3 @@ | ||
import ChatAdapterConfig from "./ChatAdapterConfig"; | ||
import IC3Config from "./IC3Config"; | ||
interface IDataMaskingSDKConfig { | ||
@@ -6,6 +8,8 @@ disable: boolean; | ||
interface IChatSDKConfig { | ||
dataMasking: IDataMaskingSDKConfig; | ||
dataMasking?: IDataMaskingSDKConfig; | ||
getAuthToken?: () => Promise<string | null>; | ||
ic3Config?: IC3Config; | ||
chatAdapterConfig?: ChatAdapterConfig; | ||
} | ||
export { IDataMaskingSDKConfig }; | ||
export default IChatSDKConfig; |
@@ -59,3 +59,5 @@ import IChatConfig from "./core/IChatConfig"; | ||
private getChatConfig; | ||
private resolveIC3ClientUrl; | ||
private resolveChatAdapterUrl; | ||
} | ||
export default OmnichannelChatSDK; |
@@ -524,3 +524,3 @@ "use strict"; | ||
case 0: | ||
ic3AdapterCDNUrl = libraries_1.default.getIC3AdapterCDNUrl(); | ||
ic3AdapterCDNUrl = this.resolveChatAdapterUrl(protocol); | ||
return [4 /*yield*/, WebUtils_1.loadScript(ic3AdapterCDNUrl, function () { | ||
@@ -533,3 +533,3 @@ /* istanbul ignore next */ | ||
userId: 'teamsvisitor', | ||
sdkURL: libraries_1.default.getIC3ClientCDNUrl() | ||
sdkURL: _this.resolveIC3ClientUrl(), | ||
}; | ||
@@ -647,3 +647,3 @@ var adapter = new window.Microsoft.BotFramework.WebChat.IC3Adapter(adapterConfig); | ||
case 0: | ||
ic3ClientCDNUrl = libraries_1.default.getIC3ClientCDNUrl(); | ||
ic3ClientCDNUrl = this.resolveIC3ClientUrl(); | ||
window.addEventListener("ic3:sdk:load", function () { return __awaiter(_this, void 0, void 0, function () { | ||
@@ -741,2 +741,23 @@ var ic3sdk, IC3SDKProvider, IC3Client; | ||
}; | ||
OmnichannelChatSDK.prototype.resolveIC3ClientUrl = function () { | ||
if (this.chatSDKConfig.ic3Config && 'ic3ClientCDNUrl' in this.chatSDKConfig.ic3Config) { | ||
return this.chatSDKConfig.ic3Config.ic3ClientCDNUrl; | ||
} | ||
if (this.chatSDKConfig.ic3Config && 'ic3ClientVersion' in this.chatSDKConfig.ic3Config) { | ||
return libraries_1.default.getIC3ClientCDNUrl(this.chatSDKConfig.ic3Config.ic3ClientVersion); | ||
} | ||
return libraries_1.default.getIC3ClientCDNUrl(); | ||
}; | ||
OmnichannelChatSDK.prototype.resolveChatAdapterUrl = function (protocol) { | ||
if (protocol !== ChatAdapterProtocols_1.default.IC3) { | ||
throw new Error("ChatAdapter for protocol " + protocol + " currently not supported"); | ||
} | ||
if (this.chatSDKConfig.chatAdapterConfig && 'webChatIC3AdapterCDNUrl' in this.chatSDKConfig.chatAdapterConfig) { | ||
return this.chatSDKConfig.chatAdapterConfig.webChatIC3AdapterCDNUrl; | ||
} | ||
if (this.chatSDKConfig.chatAdapterConfig && 'webChatIC3AdapterVersion' in this.chatSDKConfig.chatAdapterConfig) { | ||
return libraries_1.default.getIC3AdapterCDNUrl(this.chatSDKConfig.chatAdapterConfig.webChatIC3AdapterVersion); | ||
} | ||
return libraries_1.default.getIC3AdapterCDNUrl(); | ||
}; | ||
return OmnichannelChatSDK; | ||
@@ -743,0 +764,0 @@ }()); |
@@ -1,8 +0,8 @@ | ||
declare const getIC3ClientCDNUrl: () => string; | ||
declare const getIC3AdapterCDNUrl: () => string; | ||
declare const getIC3ClientCDNUrl: (version?: string) => string; | ||
declare const getIC3AdapterCDNUrl: (version?: string) => string; | ||
declare const _default: { | ||
getIC3ClientCDNUrl: () => string; | ||
getIC3AdapterCDNUrl: () => string; | ||
getIC3ClientCDNUrl: (version?: string) => string; | ||
getIC3AdapterCDNUrl: (version?: string) => string; | ||
}; | ||
export default _default; | ||
export { getIC3ClientCDNUrl, getIC3AdapterCDNUrl }; |
@@ -5,9 +5,11 @@ "use strict"; | ||
var settings_1 = require("../config/settings"); | ||
var getIC3ClientCDNUrl = function () { | ||
var IC3ClientCDNUrl = "https://comms.omnichannelengagementhub.com/release/" + settings_1.ic3ClientVersion + "/Scripts/SDK/SDK.min.js"; | ||
var getIC3ClientCDNUrl = function (version) { | ||
if (version === void 0) { version = settings_1.ic3ClientVersion; } | ||
var IC3ClientCDNUrl = "https://comms.omnichannelengagementhub.com/release/" + version + "/Scripts/SDK/SDK.min.js"; | ||
return IC3ClientCDNUrl; | ||
}; | ||
exports.getIC3ClientCDNUrl = getIC3ClientCDNUrl; | ||
var getIC3AdapterCDNUrl = function () { | ||
var IC3AdapterCDNUrl = "https://webchatic3.blob.core.windows.net/webchat-ic3adapter/" + settings_1.webChatIC3AdapterVersion + "/botframework-webchat-adapter-ic3.production.min.js"; | ||
var getIC3AdapterCDNUrl = function (version) { | ||
if (version === void 0) { version = settings_1.webChatIC3AdapterVersion; } | ||
var IC3AdapterCDNUrl = "https://webchatic3.blob.core.windows.net/webchat-ic3adapter/" + version + "/botframework-webchat-adapter-ic3.production.min.js"; | ||
return IC3AdapterCDNUrl; | ||
@@ -14,0 +16,0 @@ }; |
@@ -17,6 +17,6 @@ "use strict"; | ||
if (typeof dataMaskingConfig.disable !== "boolean") { | ||
dataMaskingConfig.disable = defaultChatSDKConfig.dataMasking.disable; | ||
dataMaskingConfig.disable = defaultChatSDKConfig.dataMasking.disable; // eslint-disable-line @typescript-eslint/no-non-null-assertion | ||
} | ||
if (typeof dataMaskingConfig.maskingCharacter !== "string" || dataMaskingConfig.maskingCharacter.length !== 1) { | ||
dataMaskingConfig.maskingCharacter = defaultChatSDKConfig.dataMasking.maskingCharacter; | ||
dataMaskingConfig.maskingCharacter = defaultChatSDKConfig.dataMasking.maskingCharacter; // eslint-disable-line @typescript-eslint/no-non-null-assertion | ||
} | ||
@@ -23,0 +23,0 @@ }; |
{ | ||
"name": "@microsoft/omnichannel-chat-sdk", | ||
"version": "0.1.1-main.3b3e3ff", | ||
"version": "0.1.1-main.4b804ff", | ||
"description": "Microsoft Omnichannel Chat SDK", | ||
@@ -5,0 +5,0 @@ "files": [ |
@@ -8,3 +8,7 @@ # Omnichannel Chat SDK | ||
Please make sure you have a chat widget configured before using this package or you can follow this [link](https://docs.microsoft.com/en-us/dynamics365/customer-service/configure-live-chat) | ||
## Table of Contents | ||
- [Live Chat Widget vs. Chat SDK](#live-chat-widget-vs-chat-sdk) | ||
- [Installation](#installation) | ||
- [API Reference](#api-reference) | ||
@@ -16,2 +20,34 @@ - [API Examples](#api-examples) | ||
## Live Chat Widget vs. Chat SDK | ||
Omnichannel offers an live chat widget (LCW) by default. You can use the Chat SDK to build your custom chat widget if: | ||
- You want to fully customize the user interface of the chat widget to conform with your branding. | ||
- You want to integrate Omnichannel in your mobile app using React Native. | ||
- You want to integrate additional functionalities that LCW does not offer. | ||
- Some other cool ideas. Please share with us on what you've achieved with the Chat SDK! 🙂 | ||
### Feature Comparisons | ||
| Feature | Live Chat Widget | Chat SDK | Notes | | ||
| ----- | ----- | ----- | ----- | | ||
| Bring Your Own Widget | ❌ | ✔ | | | ||
| Web Support | ✔ | ✔ | | ||
| React Native Support | ❌ | ✔ | | ||
| Escalation to Voice & Video | ✔ | Web Only | | ||
| Co-browse | ✔ | ❌ | | ||
| Screen Sharing | ✔ | ❌ | | ||
| Authenticated Chat | ✔ | ✔ | | ||
| Pre-chat Survey | ✔ | ✔ | | ||
| Post-chat Survey | ✔ | ❌ | | ||
| Queue Position | ✔ | ✔ | | ||
| Average Wait Time | ✔ | ✔ | | ||
| Download Transcript | ✔ | ✔ | | ||
| Email Transcript | ✔ | ✔ | | ||
| Data Masking | ✔ | ✔ | | ||
| File Attachments | ✔ | ✔ | | ||
| Custom Context | ✔ | ✔ | | ||
| Proactive Chat | ✔ | BYOI **\*** | | ||
**\*** BYOI: Bring Your Own Implementation | ||
## Installation | ||
@@ -449,3 +485,3 @@ | ||
| PreChat Survey | Requires Adaptive Cards renderer | Requires Adaptive Cards renderer | ||
| Display Attachments | Requires implementation | Provided & Customizable | | ||
| Display Attachments | Requires implementation | Basic interface provided & Customizable | | ||
| Incoming messages handling | IC3 protocol message data | DirectLine activity data | | ||
@@ -452,0 +488,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
320587
86
1629
511
0