2
0

feat(embed): 🎨 Update instructions for 2.2.0

This commit is contained in:
Baptiste Arnaud
2022-03-14 15:09:11 +01:00
parent 5a2df9fe72
commit 69701d12b9
4 changed files with 16 additions and 10 deletions

View File

@ -12,7 +12,7 @@ export const IframeEmbedCode = ({
heightLabel,
}: Props & FlexProps) => {
const { typebot } = useTypebot()
const src = `https://${typebot?.publicId}.typebot.io`
const src = `${process.env.NEXT_PUBLIC_VIEWER_URL}/${typebot?.publicId}`
const code = `<iframe src="${src}" width="${widthLabel}" height="${heightLabel}" />`
return <CodeEditor value={code} lang="html" isReadOnly />

View File

@ -89,7 +89,7 @@ export const parseInitContainerCode = ({
})
return prettier.format(
`Typebot.initContainer("typebot-container", {
publishId: "${publishId}",${bgColorString}${customDomainString}${hiddenVariablesString}
url: "${process.env.NEXT_PUBLIC_VIEWER_URL}/${publishId}",${bgColorString}${customDomainString}${hiddenVariablesString}
});`,
{ parser: 'babel', plugins: [parserBabel] }
)
@ -110,7 +110,7 @@ export const parseInitPopupCode = ({
})
const { delayString } = parsePopupParams({ delay })
return prettier.format(
`var typebotCommands = Typebot.initPopup({publishId: "${publishId}",${delayString}${bgColorString}${customDomainString}${hiddenVariablesString}});`,
`var typebotCommands = Typebot.initPopup({url: "${process.env.NEXT_PUBLIC_VIEWER_URL}/${publishId}",${delayString}${bgColorString}${customDomainString}${hiddenVariablesString}});`,
{ parser: 'babel', plugins: [parserBabel] }
)
}
@ -134,9 +134,9 @@ export const parseInitBubbleCode = ({
proactiveMessage,
})
return prettier.format(
`var typebotCommands = Typebot.initBubble({publishId: "${publishId}",${bgColorString}${customDomainString}${hiddenVariablesString}${proactiveMessageString}${buttonString}});`,
`var typebotCommands = Typebot.initBubble({url: "${process.env.NEXT_PUBLIC_VIEWER_URL}/${publishId}",${bgColorString}${customDomainString}${hiddenVariablesString}${proactiveMessageString}${buttonString}});`,
{ parser: 'babel', plugins: [parserBabel] }
)
}
export const typebotJsHtml = `<script src="https://unpkg.com/typebot-js@2.1.3"></script>`
export const typebotJsHtml = `<script src="https://unpkg.com/typebot-js@2.2.0"></script>`

View File

@ -44,11 +44,11 @@ export const NotionModal = ({
<Input
pr="4.5rem"
type={'text'}
defaultValue={`https://bot.typebot.io/${publicId}`}
defaultValue={`${process.env.NEXT_PUBLIC_VIEWER_URL}/${publicId}`}
/>
<InputRightElement width="4.5rem">
<CopyButton
textToCopy={`https://bot.typebot.io/${publicId}`}
textToCopy={`${process.env.NEXT_PUBLIC_VIEWER_URL}/${publicId}`}
/>
</InputRightElement>
</InputGroup>

View File

@ -48,11 +48,17 @@ export const WordpressModal = ({
</Link>
</ListItem>
<ListItem>
Copy your typebot ID
Copy your typebot URL
<InputGroup size="md" mt={2}>
<Input pr="4.5rem" type={'text'} defaultValue={publicId} />
<Input
pr="4.5rem"
type={'text'}
defaultValue={`${process.env.NEXT_PUBLIC_VIEWER_URL}/${publicId}`}
/>
<InputRightElement width="4.5rem">
<CopyButton textToCopy={publicId} />
<CopyButton
textToCopy={`${process.env.NEXT_PUBLIC_VIEWER_URL}/${publicId}`}
/>
</InputRightElement>
</InputGroup>
</ListItem>