🐛 New sendMessage version for the new parser
Make sure old client still communicate with old parser
This commit is contained in:
@@ -16,7 +16,7 @@ npm install @typebot.io/js
|
||||
|
||||
```
|
||||
<script type="module">
|
||||
import Typebot from 'https://cdn.jsdelivr.net/npm/@typebot.io/js@0.1/dist/web.js'
|
||||
import Typebot from 'https://cdn.jsdelivr.net/npm/@typebot.io/js@0.2/dist/web.js'
|
||||
|
||||
Typebot.initStandard({
|
||||
typebot: 'my-typebot',
|
||||
@@ -34,7 +34,7 @@ There, you can change the container dimensions. Here is a code example:
|
||||
|
||||
```html
|
||||
<script type="module">
|
||||
import Typebot from 'https://cdn.jsdelivr.net/npm/@typebot.io/js@0.1/dist/web.js'
|
||||
import Typebot from 'https://cdn.jsdelivr.net/npm/@typebot.io/js@0.2/dist/web.js'
|
||||
|
||||
Typebot.initStandard({
|
||||
typebot: 'my-typebot',
|
||||
@@ -54,7 +54,7 @@ Here is an example:
|
||||
|
||||
```html
|
||||
<script type="module">
|
||||
import Typebot from 'https://cdn.jsdelivr.net/npm/@typebot.io/js@0.1/dist/web.js'
|
||||
import Typebot from 'https://cdn.jsdelivr.net/npm/@typebot.io/js@0.2/dist/web.js'
|
||||
|
||||
Typebot.initPopup({
|
||||
typebot: 'my-typebot',
|
||||
@@ -96,7 +96,7 @@ Here is an example:
|
||||
|
||||
```html
|
||||
<script type="module">
|
||||
import Typebot from 'https://cdn.jsdelivr.net/npm/@typebot.io/js@0.1/dist/web.js'
|
||||
import Typebot from 'https://cdn.jsdelivr.net/npm/@typebot.io/js@0.2/dist/web.js'
|
||||
|
||||
Typebot.initBubble({
|
||||
typebot: 'my-typebot',
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@typebot.io/js",
|
||||
"version": "0.1.34",
|
||||
"version": "0.2.0",
|
||||
"description": "Javascript library to display typebots on your website",
|
||||
"type": "module",
|
||||
"main": "dist/index.js",
|
||||
|
||||
@@ -32,7 +32,7 @@ export async function getInitialChatReplyQuery({
|
||||
if (paymentInProgressState) removePaymentInProgressFromStorage()
|
||||
const { data, error } = await sendRequest<InitialChatReply>({
|
||||
method: 'POST',
|
||||
url: `${isNotEmpty(apiHost) ? apiHost : guessApiHost()}/api/v1/sendMessage`,
|
||||
url: `${isNotEmpty(apiHost) ? apiHost : guessApiHost()}/api/v2/sendMessage`,
|
||||
body: {
|
||||
startParams: paymentInProgressState
|
||||
? undefined
|
||||
|
||||
@@ -8,6 +8,6 @@ export const sendMessageQuery = ({
|
||||
}: SendMessageInput & { apiHost?: string }) =>
|
||||
sendRequest<ChatReply>({
|
||||
method: 'POST',
|
||||
url: `${isNotEmpty(apiHost) ? apiHost : guessApiHost()}/api/v1/sendMessage`,
|
||||
url: `${isNotEmpty(apiHost) ? apiHost : guessApiHost()}/api/v2/sendMessage`,
|
||||
body,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user