Appearance
Props reference
AWChatProps is the same shape on web and React Native.
Required
| Prop | Type | Description |
|---|---|---|
userId | string | Your user id. Maps to Intercom external_id. |
sessionToken | string | JWT signed by your server (see Auth). |
serverUrl | string | AW Chat backend base URL. |
telemetry | Telemetry | Device/app metadata (below). |
Telemetry:
| Field | Example |
|---|---|
appVersion | "6.1.4" |
hardwareId | "iPhone15,2", "web", "tma" |
osVersion | "iOS 17.4", "Android 14" |
deviceLang | "ru", "en" |
Optional
| Prop | Type | Default | Description |
|---|---|---|---|
user | { name?, email? } | — | Sets the Intercom contact's name/email (for the operator's view). |
theme | "light" | "dark" | "light" | Color scheme. |
locale | "ru" | "en" | "ru" | UI language. |
brandColor | string (hex) | glacial blue | Accent override. |
initialRoute | "hub" | "chat" | "ticket" | "hub" | Deep-link target. |
targetId | string | — | Ticket id for initialRoute: "ticket". |
skipWelcome | boolean | false | Skip the branded welcome gate, open the hub directly. |
demo | boolean | false | Mock data, no network (showcase). |
fcmToken | string | — | FCM device token → enables mobile push. |
telegramChatId | string | — | Telegram user id → enables TMA push. |
pollingInterval | number (ms) | 4000 | Base poll cadence. |
onSessionExpired | () => void | — | Fired on 401 — host should re-auth. |
onError | (error) => void | — | Global error callback ({ code, message }). |
Web-only
| Prop | Type | Default | Description |
|---|---|---|---|
fill | boolean | true | Fill the host container vs. fixed size. |
React Native-only
| Prop | Type | Description |
|---|---|---|
onPickFiles | () => Promise<PickedFile[]> | Host-provided native attachment picker. Return { uri, name, type, size }[]. Without it, the attach button 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
Open straight to a ticket from a push tap:
tsx
<AWChat initialRoute="ticket" targetId="t_12345" skipWelcome /* … */ />Push payloads include type (chat/ticket) and the id — map those to initialRoute + targetId.