@@ -6,8 +6,10 @@ import { executeScript } from '@/features/blocks/logic/script/executeScript'
|
||||
import { executeSetVariable } from '@/features/blocks/logic/setVariable/executeSetVariable'
|
||||
import { executeWait } from '@/features/blocks/logic/wait/utils/executeWait'
|
||||
import { executeWebhook } from '@/features/blocks/integrations/webhook/executeWebhook'
|
||||
import { executePixel } from '@/features/blocks/integrations/pixel/executePixel'
|
||||
import { ClientSideActionContext } from '@/types'
|
||||
import type { ChatReply, ReplyLog } from '@typebot.io/schemas'
|
||||
import { injectStartProps } from './injectStartProps'
|
||||
|
||||
export const executeClientSideAction = async (
|
||||
clientSideAction: NonNullable<ChatReply['clientSideActions']>[0],
|
||||
@@ -58,4 +60,10 @@ export const executeClientSideAction = async (
|
||||
const response = await executeWebhook(clientSideAction.webhookToExecute)
|
||||
return { replyToSend: response }
|
||||
}
|
||||
if ('startPropsToInject' in clientSideAction) {
|
||||
return injectStartProps(clientSideAction.startPropsToInject)
|
||||
}
|
||||
if ('pixel' in clientSideAction) {
|
||||
return executePixel(clientSideAction.pixel)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user