chore: support Zendesk widget (#25517)

This commit is contained in:
Nite Knite
2025-09-11 13:17:50 +08:00
committed by GitHub
parent af7f67dc9c
commit 07d067d828
8 changed files with 155 additions and 35 deletions

View File

@@ -0,0 +1,23 @@
import { IS_CE_EDITION } from '@/config'
export type ConversationField = {
id: string,
value: any,
}
declare global {
// eslint-disable-next-line ts/consistent-type-definitions
interface Window {
zE?: (
command: string,
value: string,
payload?: ConversationField[] | string | string[] | (() => any),
callback?: () => any,
) => void;
}
}
export const setZendeskConversationFields = (fields: ConversationField[], callback?: () => any) => {
if (!IS_CE_EDITION && window.zE)
window.zE('messenger:set', 'conversationFields', fields, callback)
}