2
0

docs(share): 📝 Update typebot URL in embed instructions

This commit is contained in:
Baptiste Arnaud
2022-03-21 18:52:43 +01:00
parent 11101a4600
commit 71816f76ad
10 changed files with 56 additions and 14 deletions

View File

@ -19,7 +19,10 @@ export const ChatEmbedCode = ({
const snippet = prettier.format(
createSnippet({
url: `${process.env.NEXT_PUBLIC_VIEWER_URL}/${typebot?.publicId}`,
url: `${
process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL ??
process.env.NEXT_PUBLIC_VIEWER_URL
}/${typebot?.publicId}`,
button,
proactiveMessage,
}),

View File

@ -21,7 +21,10 @@ export const ContainerEmbedCode = ({
const snippet = prettier.format(
parseSnippet({
url: `${process.env.NEXT_PUBLIC_VIEWER_URL}/${typebot?.publicId}`,
url: `${
process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL ??
process.env.NEXT_PUBLIC_VIEWER_URL
}/${typebot?.publicId}`,
heightLabel,
widthLabel,
}),

View File

@ -12,7 +12,10 @@ export const IframeEmbedCode = ({
heightLabel,
}: Props & FlexProps) => {
const { typebot } = useTypebot()
const src = `${process.env.NEXT_PUBLIC_VIEWER_URL}/${typebot?.publicId}`
const src = `${
process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL ??
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

@ -16,7 +16,10 @@ export const PopupEmbedCode = ({ delay }: PopupEmbedCodeProps & FlexProps) => {
const { typebot } = useTypebot()
const snippet = prettier.format(
createSnippet({
url: `${process.env.NEXT_PUBLIC_VIEWER_URL}/${typebot?.publicId}`,
url: `${
process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL ??
process.env.NEXT_PUBLIC_VIEWER_URL
}/${typebot?.publicId}`,
delay,
}),
{

View File

@ -19,7 +19,10 @@ export const StandardReactDiv = ({
const { typebot } = useTypebot()
const snippet = prettier.format(
parseContainerSnippet({
url: `${process.env.NEXT_PUBLIC_VIEWER_URL}/${typebot?.publicId}`,
url: `${
process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL ??
process.env.NEXT_PUBLIC_VIEWER_URL
}/${typebot?.publicId}`,
heightLabel,
widthLabel,
}),
@ -67,7 +70,10 @@ export const PopupReactCode = ({ delay }: PopupEmbedCodeProps & FlexProps) => {
const { typebot } = useTypebot()
const snippet = prettier.format(
parsePopupSnippet({
url: `${process.env.NEXT_PUBLIC_VIEWER_URL}/${typebot?.publicId}`,
url: `${
process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL ??
process.env.NEXT_PUBLIC_VIEWER_URL
}/${typebot?.publicId}`,
delay,
}),
{
@ -114,7 +120,10 @@ export const ChatReactCode = ({
const { typebot } = useTypebot()
const snippet = prettier.format(
parseBubbleSnippet({
url: `${process.env.NEXT_PUBLIC_VIEWER_URL}/${typebot?.publicId}`,
url: `${
process.env.NEXT_PUBLIC_VIEWER_INTERNAL_URL ??
process.env.NEXT_PUBLIC_VIEWER_URL
}/${typebot?.publicId}`,
button,
proactiveMessage,
}),