Skip to content

UseChatNotificationsOptions

Defined in: react/use-chat-notifications.ts:5

chatApiUrl: string

Defined in: core/types.ts:113

Base URL of the Chat API, e.g. https://chat.centralcodestation.com/api/v1

ChatNotificationsClientOptions.chatApiUrl


tenantId: string

Defined in: core/types.ts:115

The tenant (Identity Server tenant id) whose Chat events to receive.

ChatNotificationsClientOptions.tenantId


applicationId: string

Defined in: core/types.ts:117

The application context within that tenant (the Chat app itself, or a tenant application).

ChatNotificationsClientOptions.applicationId


getAccessToken: () => string | Promise<string | null | undefined> | null | undefined

Defined in: core/types.ts:119

Returns the current user’s own CCS access token (a user-session JWT) — sync or async, re-read on every (re)connect so a refreshed token is picked up automatically.

string | Promise<string | null | undefined> | null | undefined

ChatNotificationsClientOptions.getAccessToken


optional fetch?: {(input, init?): Promise<Response>; (input, init?): Promise<Response>; }

Defined in: core/types.ts:121

Override the fetch implementation (tests, or a runtime with no global fetch). Defaults to globalThis.fetch.

(input, init?): Promise<Response>

MDN Reference

URL | RequestInfo

RequestInit

Promise<Response>

(input, init?): Promise<Response>

MDN Reference

string | URL | Request

RequestInit

Promise<Response>

ChatNotificationsClientOptions.fetch


optional eventSourceFactory?: (url) => ChatEventSourceLike

Defined in: core/types.ts:123

Override how an event stream connection is created (tests, or a runtime needing an EventSource polyfill). Defaults to new globalThis.EventSource(url).

string

ChatEventSourceLike

ChatNotificationsClientOptions.eventSourceFactory


optional tokenRefreshBufferSeconds?: number

Defined in: core/types.ts:125

Seconds before the minted realtime token’s expiry to proactively reconnect with a fresh one. Default 30.

ChatNotificationsClientOptions.tokenRefreshBufferSeconds


optional debug?: boolean

Defined in: core/types.ts:127

Logs connection lifecycle and error detail to the console (prefixed [ChatNotificationsClient]) — off by default, since stream errors are otherwise swallowed on purpose (a flaky realtime connection must never throw into caller code). Turn on while developing/debugging a connection issue.

ChatNotificationsClientOptions.debug


optional enabled?: boolean

Defined in: react/use-chat-notifications.ts:7

When false, the client stays (or becomes) disconnected — flip to true once e.g. the user is authenticated. Defaults to true.