2
0

🐛 (chat) Enable prefilledVariables in preview mode

Also make list values compatible
This commit is contained in:
Baptiste Arnaud
2024-02-28 14:49:04 +01:00
parent 229453d3d3
commit 9b656214d1
7 changed files with 28 additions and 10 deletions

View File

@@ -82,6 +82,7 @@ export async function startChatQuery({
isStreamEnabled: true,
startFrom,
typebot,
prefilledVariables,
} satisfies Omit<StartPreviewChatInput, 'typebotId'>,
timeout: false,
}

View File

@@ -328,9 +328,11 @@ export const leadGenerationTypebot: StartTypebot = {
id: 'clckrl870000y3b6sxyd24qwc',
type: BubbleBlockType.TEXT,
content: {
html: '<div>Hi {{Name}}!</div>',
richText: [{ type: 'p', children: [{ text: 'Hi {{Name}}!' }] }],
plainText: 'Hi {{Name}}!',
html: '<div>Hi {{={{Name}}[0]=}}!</div>',
richText: [
{ type: 'p', children: [{ text: 'Hi {{={{Name}}[0]=}}!' }] },
],
plainText: 'Hi {{={{Name}}[0]=}}!',
},
outgoingEdgeId: 'clckrlwmd00163b6sjlass4p8',
},
@@ -443,7 +445,7 @@ export const leadGenerationTypebot: StartTypebot = {
},
},
settings: {
general: { isBrandingEnabled: true },
general: { isBrandingEnabled: true, isInputPrefillEnabled: true },
metadata: {
description:
'Build beautiful conversational forms and embed them directly in your applications without a line of code. Triple your response rate and collect answers that has more value compared to a traditional form.',

View File

@@ -39,7 +39,7 @@ export const Default = () => {
typebot={leadGenerationTypebot}
apiHost="http://localhost:3001"
prefilledVariables={{
Name: 'John',
Name: ['John'],
}}
previewMessage={{
avatarUrl: 'https://avatars.githubusercontent.com/u/16015833?v=4',