@robylon/whatsapp-react-sdk 1.0.0-staging.1 → 1.0.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/README.md +11 -11
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/ChatbotIframe.d.ts +16 -0
- package/dist/cjs/types/constants/fontStyles.d.ts +0 -2
- package/dist/cjs/types/core/api.d.ts +0 -2
- package/dist/cjs/types/types.d.ts +0 -8
- package/dist/cjs/types/vanilla/components/ChatbotIframe.d.ts +92 -0
- package/dist/esm/index.js +2 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/ChatbotIframe.d.ts +16 -0
- package/dist/esm/types/constants/fontStyles.d.ts +0 -2
- package/dist/esm/types/core/api.d.ts +0 -2
- package/dist/esm/types/types.d.ts +0 -8
- package/dist/esm/types/vanilla/components/ChatbotIframe.d.ts +92 -0
- package/dist/index.d.ts +0 -8
- 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 +16 -0
- package/dist/umd/types/constants/fontStyles.d.ts +0 -2
- package/dist/umd/types/core/api.d.ts +0 -2
- package/dist/umd/types/types.d.ts +0 -8
- package/dist/umd/types/vanilla/components/ChatbotIframe.d.ts +92 -0
- package/package.json +1 -1
- package/dist/cjs/types/components/ChatWidgetPopup.d.ts +0 -8
- package/dist/cjs/types/vanilla/components/ChatWidgetPopup.d.ts +0 -17
- package/dist/esm/types/components/ChatWidgetPopup.d.ts +0 -8
- package/dist/esm/types/vanilla/components/ChatWidgetPopup.d.ts +0 -17
- package/dist/umd/types/components/ChatWidgetPopup.d.ts +0 -8
- package/dist/umd/types/vanilla/components/ChatWidgetPopup.d.ts +0 -17
package/README.md
CHANGED
|
@@ -33,7 +33,7 @@ yarn add @robylon/whatsapp-react-sdk
|
|
|
33
33
|
Add this script to your website by copying and pasting the following code into the `<head>` section of your HTML:
|
|
34
34
|
|
|
35
35
|
```html
|
|
36
|
-
<script src="https://cdn.robylon.ai/
|
|
36
|
+
<script src="https://cdn.robylon.ai/sdk/latest/chatbot.js"></script>
|
|
37
37
|
```
|
|
38
38
|
|
|
39
39
|
#### Where to place the script:
|
|
@@ -214,7 +214,7 @@ This prevents race conditions and provides a smooth user experience.
|
|
|
214
214
|
This is the simplest way to add the Robylon chatbot to any website with a single line of code. Just copy and paste this script tag into your HTML:
|
|
215
215
|
|
|
216
216
|
```
|
|
217
|
-
<script>(function(k){window.R=window.R||function(){(window.R.q=window.R.q||[]).push(arguments)};window.R=new Proxy(window.R,{get:(t,p)=>p==="q"?t.q:(...a)=>t(p,...a)});function l(){var s=document.createElement("script");s.src="https://cdn.robylon.ai/
|
|
217
|
+
<script>(function(k){window.R=window.R||function(){(window.R.q=window.R.q||[]).push(arguments)};window.R=new Proxy(window.R,{get:(t,p)=>p==="q"?t.q:(...a)=>t(p,...a)});function l(){var s=document.createElement("script");s.src="https://cdn.robylon.ai/sdk/latest/chatbot.js";s.onload=()=>k&&window.RobylonChatbot.create({api_key:k});document.body.appendChild(s)}document.readyState==="complete"?l():window.addEventListener("load",l)})("YOUR_API_KEY_HERE");</script>
|
|
218
218
|
```
|
|
219
219
|
|
|
220
220
|
Just replace `YOUR_API_KEY_HERE` with your actual Robylon API key, and you're done! No additional code is needed.
|
|
@@ -226,7 +226,7 @@ Just replace `YOUR_API_KEY_HERE` with your actual Robylon API key, and you're do
|
|
|
226
226
|
For older browsers that don't support ES6 features, use this ES5 compatible version:
|
|
227
227
|
|
|
228
228
|
```
|
|
229
|
-
<script>(function(a){window.R=window.R||function(){(window.R.q=window.R.q||[]).push(Array.prototype.slice.call(arguments))};window.R.show=function(){window.R('show')};window.R.hide=function(){window.R('hide')};window.R.toggle=function(){window.R('toggle')};window.R.track=function(){window.R('track',Array.prototype.slice.call(arguments))};var o=function(){var s=document.createElement("script");s.src="https://cdn.robylon.ai/
|
|
229
|
+
<script>(function(a){window.R=window.R||function(){(window.R.q=window.R.q||[]).push(Array.prototype.slice.call(arguments))};window.R.show=function(){window.R('show')};window.R.hide=function(){window.R('hide')};window.R.toggle=function(){window.R('toggle')};window.R.track=function(){window.R('track',Array.prototype.slice.call(arguments))};var o=function(){var s=document.createElement("script");s.src="https://cdn.robylon.ai/sdk/latest/chatbot.js";s.id="robylon-chatbot-sdk";s.onload=function(){if(a){window.RobylonChatbot.create({api_key:a})}};document.body.appendChild(s)};if(document.readyState==="complete"){o()}else{window.addEventListener("load",o)}})("YOUR_API_KEY_HERE");</script>
|
|
230
230
|
```
|
|
231
231
|
|
|
232
232
|
This version is compatible with Internet Explorer 11 and other older browsers that don't support ES6 features like arrow functions, `const`/`let`, and Proxy objects.
|
|
@@ -236,7 +236,7 @@ This version is compatible with Internet Explorer 11 and other older browsers th
|
|
|
236
236
|
If you want to customize the position and spacing of the chatbot button, you can use this alternative version:
|
|
237
237
|
|
|
238
238
|
```
|
|
239
|
-
<script>(function(k,p,side,bottom){window.R=window.R||function(){(window.R.q=window.R.q||[]).push(arguments)};window.R=new Proxy(window.R,{get:(t,p)=>p==="q"?t.q:(...a)=>t(p,...a)});function l(){var s=document.createElement("script");s.src="https://cdn.robylon.ai/
|
|
239
|
+
<script>(function(k,p,side,bottom){window.R=window.R||function(){(window.R.q=window.R.q||[]).push(arguments)};window.R=new Proxy(window.R,{get:(t,p)=>p==="q"?t.q:(...a)=>t(p,...a)});function l(){var s=document.createElement("script");s.src="https://cdn.robylon.ai/sdk/latest/chatbot.js";s.onload=()=>k&&window.RobylonChatbot.create({api_key:k,position:p,sideSpacing:side,bottomSpacing:bottom});document.body.appendChild(s)}document.readyState==="complete"?l():window.addEventListener("load",l)})("YOUR_API_KEY_HERE","Left",30,25);</script>
|
|
240
240
|
```
|
|
241
241
|
|
|
242
242
|
Just replace:
|
|
@@ -251,7 +251,7 @@ Just replace:
|
|
|
251
251
|
For older browsers, use this ES5 compatible version with custom positioning:
|
|
252
252
|
|
|
253
253
|
```
|
|
254
|
-
<script>(function(a,p,s,b){window.R=window.R||function(){(window.R.q=window.R.q||[]).push(Array.prototype.slice.call(arguments))};window.R.show=function(){window.R('show')};window.R.hide=function(){window.R('hide')};window.R.toggle=function(){window.R('toggle')};window.R.track=function(){window.R('track',Array.prototype.slice.call(arguments))};var o=function(){var s=document.createElement("script");s.src="https://cdn.robylon.ai/
|
|
254
|
+
<script>(function(a,p,s,b){window.R=window.R||function(){(window.R.q=window.R.q||[]).push(Array.prototype.slice.call(arguments))};window.R.show=function(){window.R('show')};window.R.hide=function(){window.R('hide')};window.R.toggle=function(){window.R('toggle')};window.R.track=function(){window.R('track',Array.prototype.slice.call(arguments))};var o=function(){var s=document.createElement("script");s.src="https://cdn.robylon.ai/sdk/latest/chatbot.js";s.id="robylon-chatbot-sdk";s.onload=function(){if(a){window.RobylonChatbot.create({api_key:a,position:p,sideSpacing:s,bottomSpacing:b})}};document.body.appendChild(s)};if(document.readyState==="complete"){o()}else{window.addEventListener("load",o)}})("YOUR_API_KEY_HERE","Left",30,25);</script>
|
|
255
255
|
```
|
|
256
256
|
|
|
257
257
|
Replace the same parameters as above for the ES5 compatible version.
|
|
@@ -273,7 +273,7 @@ This is the simplest approach for any website. The chatbot loads while the page
|
|
|
273
273
|
|
|
274
274
|
```html
|
|
275
275
|
<script
|
|
276
|
-
src="https://cdn.robylon.ai/
|
|
276
|
+
src="https://cdn.robylon.ai/sdk/latest/robylon-chatbot.js"
|
|
277
277
|
defer
|
|
278
278
|
></script>
|
|
279
279
|
<script>
|
|
@@ -300,7 +300,7 @@ This is the simplest approach for any website. The chatbot loads while the page
|
|
|
300
300
|
<title>Robylon SDK - Quick Setup</title>
|
|
301
301
|
<!-- COPY FROM HERE -->
|
|
302
302
|
<script
|
|
303
|
-
src="https://cdn.robylon.ai/
|
|
303
|
+
src="https://cdn.robylon.ai/sdk/latest/robylon-chatbot.js"
|
|
304
304
|
defer
|
|
305
305
|
></script>
|
|
306
306
|
<script>
|
|
@@ -334,7 +334,7 @@ This approach ensures the chatbot only initializes after your page is fully load
|
|
|
334
334
|
1️⃣ **Add this to your HTML `<head>` section:**
|
|
335
335
|
|
|
336
336
|
```html
|
|
337
|
-
<script src="https://cdn.robylon.ai/
|
|
337
|
+
<script src="https://cdn.robylon.ai/sdk/latest/robylon-chatbot.js"></script>
|
|
338
338
|
```
|
|
339
339
|
|
|
340
340
|
2️⃣ **Add this at the end of your HTML `<body>` section:**
|
|
@@ -363,7 +363,7 @@ This approach ensures the chatbot only initializes after your page is fully load
|
|
|
363
363
|
<head>
|
|
364
364
|
<title>Robylon SDK - Reliable Loading</title>
|
|
365
365
|
<!-- COPY FROM HERE -->
|
|
366
|
-
<script src="https://cdn.robylon.ai/
|
|
366
|
+
<script src="https://cdn.robylon.ai/sdk/latest/robylon-chatbot.js"></script>
|
|
367
367
|
<!-- COPY UNTIL HERE -->
|
|
368
368
|
</head>
|
|
369
369
|
<body>
|
|
@@ -397,7 +397,7 @@ This approach loads the chatbot after user data is available. Great for websites
|
|
|
397
397
|
|
|
398
398
|
```html
|
|
399
399
|
<script
|
|
400
|
-
src="https://cdn.robylon.ai/
|
|
400
|
+
src="https://cdn.robylon.ai/sdk/latest/robylon-chatbot.js"
|
|
401
401
|
defer
|
|
402
402
|
></script>
|
|
403
403
|
```
|
|
@@ -443,7 +443,7 @@ This approach loads the chatbot after user data is available. Great for websites
|
|
|
443
443
|
<title>My Website</title>
|
|
444
444
|
<!-- COPY FROM HERE -->
|
|
445
445
|
<script
|
|
446
|
-
src="https://cdn.robylon.ai/
|
|
446
|
+
src="https://cdn.robylon.ai/sdk/latest/robylon-chatbot.js"
|
|
447
447
|
defer
|
|
448
448
|
></script>
|
|
449
449
|
<!-- COPY UNTIL HERE -->
|