feat(embed): 🎨 Update instructions for 2.2.0
This commit is contained in:
@ -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 />
|
||||
|
@ -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>`
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
Reference in New Issue
Block a user