@blumessage/react-chat 1.5.2 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/BlumessageChat.js
CHANGED
|
@@ -237,7 +237,7 @@ primaryColor = "linear-gradient(to right, #3b82f6,rgb(8, 98, 242))",
|
|
|
237
237
|
// Help bubble props
|
|
238
238
|
showHelpBubble = true, helpBubbleMessage = "Have a question? We're here to help!", helpBubbleIcon = 'message-circle-question-mark', helpBubbleIconName, helpBubbleShowAfter = 1, // 1 second
|
|
239
239
|
helpBubbleHideAfter = 5, // 5 seconds
|
|
240
|
-
helpBubbleBackgroundColor = "#000000", }, ref) => {
|
|
240
|
+
helpBubbleBackgroundColor = "#000000", context, }, ref) => {
|
|
241
241
|
const [isInitialized, setIsInitialized] = (0, react_1.useState)(false);
|
|
242
242
|
const [error, setError] = (0, react_1.useState)(null);
|
|
243
243
|
const [messages, setMessages] = (0, react_1.useState)(initialMessages);
|
|
@@ -496,6 +496,10 @@ helpBubbleBackgroundColor = "#000000", }, ref) => {
|
|
|
496
496
|
if (token) {
|
|
497
497
|
requestBody.token = token;
|
|
498
498
|
}
|
|
499
|
+
// Include user context if provided
|
|
500
|
+
if (context && Object.keys(context).length > 0) {
|
|
501
|
+
requestBody.context = context;
|
|
502
|
+
}
|
|
499
503
|
const response = await fetch('https://api.blumessage.com/api/v1/conversations', {
|
|
500
504
|
method: 'POST',
|
|
501
505
|
headers: {
|
|
@@ -711,6 +715,10 @@ helpBubbleBackgroundColor = "#000000", }, ref) => {
|
|
|
711
715
|
if (token) {
|
|
712
716
|
requestBody.token = token;
|
|
713
717
|
}
|
|
718
|
+
// Include user context if provided
|
|
719
|
+
if (context && Object.keys(context).length > 0) {
|
|
720
|
+
requestBody.context = context;
|
|
721
|
+
}
|
|
714
722
|
const response = await fetch('https://api.blumessage.com/api/v1/conversations', {
|
|
715
723
|
method: 'POST',
|
|
716
724
|
headers: {
|