refactor: update externalName references in widget configuration and SDK

This commit is contained in:
mlogclub
2026-04-27 16:51:13 +08:00
parent cd9de63860
commit bc98fc572f
6 changed files with 8 additions and 9 deletions
+3 -3
View File
@@ -6,13 +6,13 @@ export type KefuWidgetHostConfig = {
externalSource?: string
/** 外部访客稳定标识;未传时使用浏览器本地访客 ID */
externalId?: string
/** 访客展示名,随请求以 X-External-Name / WS query externalName 传给后端 */
externalName?: string
title?: string
subtitle?: string
position?: "left" | "right"
themeColor?: string
width?: string
/** 访客展示名,随请求以 X-External-Name / WS query externalName 传给后端 */
subject?: string
}
declare global {
@@ -51,12 +51,12 @@ export function readKefuWidgetConfig(): KefuWidgetHostConfig {
process.env.NEXT_PUBLIC_OPEN_IM_EXTERNAL_SOURCE?.trim() ??
undefined,
externalId: query.get("externalId") ?? undefined,
externalName: query.get("externalName") ?? undefined,
title: query.get("title") ?? undefined,
subtitle: query.get("subtitle") ?? undefined,
position: (query.get("position") as "left" | "right" | null) ?? undefined,
themeColor: query.get("themeColor") ?? undefined,
width: query.get("width") ?? undefined,
subject: query.get("subject") ?? undefined,
}
return window.__CS_AGENT_WIDGET_CONFIG__ ?? window.CSAgentConfig ?? fallback