@robylon/web-react-sdk 1.1.41 → 1.1.43
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/README.md +108 -0
- package/dist/cjs/index.js +3 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/ChatbotIframe.d.ts +2 -0
- package/dist/cjs/types/components/RobylonChatbot.d.ts +10 -0
- package/dist/cjs/types/core/config.d.ts +7 -0
- package/dist/cjs/types/types.d.ts +30 -1
- package/dist/cjs/types/utils/fetchData.d.ts +1 -1
- package/dist/cjs/types/utils/proactive.d.ts +16 -1
- package/dist/cjs/types/utils/sanitize.d.ts +4 -0
- package/dist/cjs/types/utils/url.d.ts +8 -0
- package/dist/cjs/types/vanilla/components/ChatbotFloatingButton.d.ts +8 -0
- package/dist/cjs/types/vanilla/components/ChatbotIframe.d.ts +11 -0
- package/dist/cjs/types/vanilla/index.d.ts +5 -0
- package/dist/esm/index.js +3 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/ChatbotIframe.d.ts +2 -0
- package/dist/esm/types/components/RobylonChatbot.d.ts +10 -0
- package/dist/esm/types/core/config.d.ts +7 -0
- package/dist/esm/types/types.d.ts +30 -1
- package/dist/esm/types/utils/fetchData.d.ts +1 -1
- package/dist/esm/types/utils/proactive.d.ts +16 -1
- package/dist/esm/types/utils/sanitize.d.ts +4 -0
- package/dist/esm/types/utils/url.d.ts +8 -0
- package/dist/esm/types/vanilla/components/ChatbotFloatingButton.d.ts +8 -0
- package/dist/esm/types/vanilla/components/ChatbotIframe.d.ts +11 -0
- package/dist/esm/types/vanilla/index.d.ts +5 -0
- package/dist/index.d.ts +46 -2
- package/dist/umd/robylon-chatbot.js +1 -1
- package/dist/umd/robylon-chatbot.js.map +1 -1
- package/dist/umd/types/components/ChatbotIframe.d.ts +2 -0
- package/dist/umd/types/components/RobylonChatbot.d.ts +10 -0
- package/dist/umd/types/core/config.d.ts +7 -0
- package/dist/umd/types/types.d.ts +30 -1
- package/dist/umd/types/utils/fetchData.d.ts +1 -1
- package/dist/umd/types/utils/proactive.d.ts +16 -1
- package/dist/umd/types/utils/sanitize.d.ts +4 -0
- package/dist/umd/types/utils/url.d.ts +8 -0
- package/dist/umd/types/vanilla/components/ChatbotFloatingButton.d.ts +8 -0
- package/dist/umd/types/vanilla/components/ChatbotIframe.d.ts +11 -0
- package/dist/umd/types/vanilla/index.d.ts +5 -0
- package/package.json +5 -3
package/README.md
CHANGED
|
@@ -534,6 +534,7 @@ The SDK supports the following configuration options for both React and plain Ja
|
|
|
534
534
|
| sideSpacing | number | Distance from the side of the screen (in px) | Optional |
|
|
535
535
|
| bottomSpacing | number | Distance from the bottom of the screen (in px) | Optional |
|
|
536
536
|
| show_launcher | boolean | Show the floating launcher button (default: true) | Optional |
|
|
537
|
+
| overrides | object | Customize chatbot header appearance | Optional |
|
|
537
538
|
|
|
538
539
|
### Position and Spacing Configuration
|
|
539
540
|
|
|
@@ -569,6 +570,113 @@ RobylonChatbot.create({
|
|
|
569
570
|
});
|
|
570
571
|
```
|
|
571
572
|
|
|
573
|
+
### Overrides Configuration
|
|
574
|
+
|
|
575
|
+
The `overrides` prop allows you to customize the chatbot header appearance, including avatars, titles, and styling. This is useful for branding or personalizing the chatbot interface.
|
|
576
|
+
|
|
577
|
+
#### Overrides Options
|
|
578
|
+
|
|
579
|
+
| Option | Type | Description |
|
|
580
|
+
| ---------------------------- | ------ | ------------------------------------------ |
|
|
581
|
+
| `header_avatar` | string | URL for the header avatar image |
|
|
582
|
+
| `agent_avatar` | string | URL for the agent avatar image |
|
|
583
|
+
| `header_title` | string | Custom header title text |
|
|
584
|
+
| `header_subtitle` | string | Custom header subtitle text |
|
|
585
|
+
| `header_title_text_color` | string | CSS color value for the title text |
|
|
586
|
+
| `header_subtitle_text_color` | string | CSS color value for the subtitle text |
|
|
587
|
+
| `header_bg` | string | CSS color or URL for the header background |
|
|
588
|
+
|
|
589
|
+
#### React Example:
|
|
590
|
+
|
|
591
|
+
```jsx
|
|
592
|
+
<Chatbot
|
|
593
|
+
api_key="YOUR_API_KEY"
|
|
594
|
+
overrides={{
|
|
595
|
+
header_avatar: "https://example.com/header-avatar.png",
|
|
596
|
+
agent_avatar: "https://example.com/agent-avatar.png",
|
|
597
|
+
header_title: "Support Team",
|
|
598
|
+
header_subtitle: "We're here to help",
|
|
599
|
+
header_title_text_color: "#1a1a1a",
|
|
600
|
+
header_subtitle_text_color: "#666666",
|
|
601
|
+
header_bg: "#ffffff",
|
|
602
|
+
}}
|
|
603
|
+
/>
|
|
604
|
+
```
|
|
605
|
+
|
|
606
|
+
#### React: Partial Overrides
|
|
607
|
+
|
|
608
|
+
You can provide only the overrides you want to customize. Omitted properties will use their default values:
|
|
609
|
+
|
|
610
|
+
```jsx
|
|
611
|
+
<Chatbot
|
|
612
|
+
api_key="YOUR_API_KEY"
|
|
613
|
+
overrides={{
|
|
614
|
+
header_title: "Custom Title",
|
|
615
|
+
header_title_text_color: "#007bff",
|
|
616
|
+
}}
|
|
617
|
+
/>
|
|
618
|
+
```
|
|
619
|
+
|
|
620
|
+
#### Plain JavaScript Example:
|
|
621
|
+
|
|
622
|
+
```javascript
|
|
623
|
+
RobylonChatbot.create({
|
|
624
|
+
api_key: "YOUR_API_KEY",
|
|
625
|
+
overrides: {
|
|
626
|
+
header_avatar: "https://example.com/header-avatar.png",
|
|
627
|
+
agent_avatar: "https://example.com/agent-avatar.png",
|
|
628
|
+
header_title: "Support Team",
|
|
629
|
+
header_subtitle: "We're here to help",
|
|
630
|
+
header_title_text_color: "#1a1a1a",
|
|
631
|
+
header_subtitle_text_color: "#666666",
|
|
632
|
+
header_bg: "#ffffff",
|
|
633
|
+
},
|
|
634
|
+
});
|
|
635
|
+
```
|
|
636
|
+
|
|
637
|
+
#### Plain JavaScript: Updating Overrides
|
|
638
|
+
|
|
639
|
+
To update overrides after initialization, you'll need to recreate the chatbot instance with new overrides:
|
|
640
|
+
|
|
641
|
+
```javascript
|
|
642
|
+
let chatbot = RobylonChatbot.create({
|
|
643
|
+
api_key: "YOUR_API_KEY",
|
|
644
|
+
overrides: {
|
|
645
|
+
header_title: "Initial Title",
|
|
646
|
+
},
|
|
647
|
+
});
|
|
648
|
+
|
|
649
|
+
// Later, destroy and recreate with new overrides
|
|
650
|
+
chatbot.destroy();
|
|
651
|
+
chatbot = RobylonChatbot.create({
|
|
652
|
+
api_key: "YOUR_API_KEY",
|
|
653
|
+
overrides: {
|
|
654
|
+
header_title: "Updated Title",
|
|
655
|
+
header_title_text_color: "#ff0000",
|
|
656
|
+
},
|
|
657
|
+
});
|
|
658
|
+
```
|
|
659
|
+
|
|
660
|
+
#### Color Format Examples
|
|
661
|
+
|
|
662
|
+
Colors can be specified in any valid CSS color format:
|
|
663
|
+
|
|
664
|
+
```jsx
|
|
665
|
+
<Chatbot
|
|
666
|
+
api_key="YOUR_API_KEY"
|
|
667
|
+
overrides={{
|
|
668
|
+
// Hex color
|
|
669
|
+
header_title_text_color: "#1a1a1a",
|
|
670
|
+
// RGB
|
|
671
|
+
header_subtitle_text_color: "rgb(102, 102, 102)",
|
|
672
|
+
// RGBA
|
|
673
|
+
header_bg: "rgba(255, 255, 255, 0.95)",
|
|
674
|
+
// Named color
|
|
675
|
+
header_title_text_color: "navy",
|
|
676
|
+
}}
|
|
677
|
+
/>
|
|
678
|
+
```
|
|
679
|
+
|
|
572
680
|
## Event Handling
|
|
573
681
|
|
|
574
682
|
### Supported Events
|