⚡ (wp) Add custom api host for WP plugin
This commit is contained in:
@ -14,6 +14,8 @@ import { useState } from 'react'
|
||||
import { BubbleSettings } from '../../../settings/BubbleSettings/BubbleSettings'
|
||||
import { parseInitBubbleCode } from '../../../snippetParsers'
|
||||
import { parseDefaultBubbleTheme } from '../../Javascript/instructions/JavascriptBubbleInstructions'
|
||||
import { isCloudProdInstance } from '@/utils/helpers'
|
||||
import { env, getViewerUrl } from 'utils'
|
||||
|
||||
type Props = {
|
||||
publicId: string
|
||||
@ -29,6 +31,9 @@ export const WordpressBubbleInstructions = ({ publicId }: Props) => {
|
||||
|
||||
const initCode = parseInitBubbleCode({
|
||||
typebot: publicId,
|
||||
apiHost: isCloudProdInstance
|
||||
? undefined
|
||||
: env('VIEWER_INTERNAL_URL') ?? getViewerUrl(),
|
||||
theme: {
|
||||
...theme,
|
||||
chatWindow: {
|
||||
|
@ -11,6 +11,8 @@ import {
|
||||
import { useState } from 'react'
|
||||
import { PopupSettings } from '../../../settings/PopupSettings'
|
||||
import { parseInitPopupCode } from '../../../snippetParsers/popup'
|
||||
import { isCloudProdInstance } from '@/utils/helpers'
|
||||
import { env, getViewerUrl } from 'utils'
|
||||
|
||||
type Props = {
|
||||
publicId: string
|
||||
@ -20,6 +22,9 @@ export const WordpressPopupInstructions = ({ publicId }: Props) => {
|
||||
|
||||
const initCode = parseInitPopupCode({
|
||||
typebot: publicId,
|
||||
apiHost: isCloudProdInstance
|
||||
? undefined
|
||||
: env('VIEWER_INTERNAL_URL') ?? getViewerUrl(),
|
||||
autoShowDelay,
|
||||
})
|
||||
|
||||
|
@ -11,6 +11,8 @@ import {
|
||||
} from '@chakra-ui/react'
|
||||
import { useState } from 'react'
|
||||
import { StandardSettings } from '../../../settings/StandardSettings'
|
||||
import { isCloudProdInstance } from '@/utils/helpers'
|
||||
import { env, getViewerUrl } from 'utils'
|
||||
|
||||
type Props = {
|
||||
publicId: string
|
||||
@ -73,8 +75,10 @@ const parseWordpressShortcode = ({
|
||||
height?: string
|
||||
publicId: string
|
||||
}) => {
|
||||
return `[typebot typebot="${publicId}"${width ? ` width="${width}"` : ''}${
|
||||
height ? ` height="${height}"` : ''
|
||||
}]
|
||||
return `[typebot typebot="${publicId}"${
|
||||
isCloudProdInstance
|
||||
? ''
|
||||
: ` apiHost="${env('VIEWER_INTERNAL_URL') ?? getViewerUrl()}"`
|
||||
}${width ? ` width="${width}"` : ''}${height ? ` height="${height}"` : ''}]
|
||||
`
|
||||
}
|
||||
|
Reference in New Issue
Block a user