Skip to content

Props reference

AWChatProps is the same shape on web and React Native unless noted.

Required (for live mode)

These four are required to talk to a backend. In demo mode they're optional.

PropTypeDescription
userIdstringYour user id. Maps to Intercom external_id.
sessionTokenstringJWT signed by your server (see Auth).
serverUrlstringAW Chat backend base URL on your infrastructure.
telemetryTelemetryDevice/app metadata (below).

Telemetry:

FieldExample
appVersion"6.1.4"
hardwareId"iPhone15,2", "web", "tma"
osVersion"iOS 17.4", "Android 14"
deviceLang"ru", "en"

Optional

PropTypeDefaultDescription
user{ name?, email? }Sets the Intercom contact's name/email (operator view).
userDisplayNamestringName on the user's own channel comments. See Comments.
userAvatarUrlstringAvatar on the user's own comments. Falls back to initials.
theme"light" | "dark""light"Color scheme.
locale"ru" | "en""ru"UI language.
brandColorstring (hex)glacial blueAccent override.
backgroundColor{ light?, dark? }Optional screen background per theme.
onClose() => voidUser backed out of hub/welcome — host should dismiss Support.
initialRoute"hub" | "chat" | "ticket""hub"Deep-link target.
targetIdstringTicket id for initialRoute: "ticket".
skipWelcomebooleanfalseSkip the welcome gate; open the hub.
demobooleanfalseMock data, no network.
fcmTokenstringFCM device token → mobile push.
telegramChatIdstringTelegram user id → TMA push.
pollingIntervalnumber (ms)4000Base poll cadence.
onSessionExpired() => voidFired on 401 — host should refresh the JWT.
onError(error) => voidGlobal error callback ({ code, message }).

Account switch

When userId / sessionToken change (logout → another user), remount <AWChat /> or ensure the live store re-inits. Otherwise channel/comment state from the previous user can linger for the session.

Web-only

PropTypeDefaultDescription
fillbooleantrueFill the host container vs fixed size.

React Native-only

PropTypeDescription
onPickFiles() => Promise<PickedFile[]>Required for attachments. Host native picker. Return { uri, name, type, size }[]. Without it, the attach control is hidden.
tsx
onPickFiles={async () => {
  const r = await ImagePicker.launchImageLibraryAsync();
  return r.canceled
    ? []
    : r.assets.map((a) => ({
        uri: a.uri,
        name: a.fileName!,
        type: a.mimeType!,
        size: a.fileSize,
      }));
}}

Deep linking

tsx
<AWChat initialRoute="ticket" targetId="t_12345" skipWelcome /* … */ />

Push payloads include type (chat / ticket) and an id — map to initialRoute + targetId.

AW Chat SDK — integration & platform handoff docs.