Skip to main content
This page is the complete lookup for offline support in the CometChat JavaScript SDK. For guided walkthroughs, start with Offline Support.
Offline support requires SDK 4.3.0 or later.

OfflineConfig options

Pass these keys in the object given to AppSettingsBuilder.setOfflineConfig(...). Every key is optional except enabled, which must be an explicit true. Bad values are corrected, never rejected, and unknown keys are ignored. You can also pass true/false as a shorthand with AppSettingsBuilder.offline(...). Count caps are always bounded and have no “unlimited” setting. Byte and day caps treat <= 0 as unlimited.

Public methods on CometChat

On the returned UploadFileRequest, getItems() lists each file’s status and retryAttachment(fileId) (optionally with an UploadFileListener) retries one failed file. New batches are created with CometChat.createUploadFileRequest; see Upload Files.

Listener registration

Sync and cache-reset registrations are valid at any time, including before login, and survive logout, login and restarts. Registering the same name twice replaces the first listener.

Listeners and callbacks

Every listener is constructed with an object of callbacks, for example new CometChat.MessageFetchListener({ onCachedMessages, onServerMessages, onError }).

Two-phase fetch listeners

BannedMemberFetchListener also still accepts the older onCachedBannedMembers / onServerBannedMembers names.

Send, sync, cache, and media listeners

Enums

All enums are string-valued and exposed on the CometChat namespace (for example CometChat.MessageStatus.PENDING).

Model fields

Error codes

The offline-related codes the SDK raises:

Cache-supported filters

A cached read answers only if every filter on the request can be computed locally. One server-only filter empties the cached phase while the server phase still answers in full. Enrichment flags (withTags, withParent, mentions-with-tag/blocked info, withUserAndGroupTags) decorate a result without narrowing it and never gate the cache. Entity lists (users, groups, members, banned members, reactions, notification feed, threads) are replayed from recorded requests rather than filtered locally. A request with a search keyword is not recorded, and neither is a UsersRequest or GroupMembersRequest with a status filter, so their cached phase is empty. Pinned and saved message reads are answered from their own lists, not from the message cache.

Deprecated overloads and replacements

Nothing is deprecated for the main fetch and send methods: the listener is an additive optional argument and every method keeps returning its Promise. With offline off, a listener-bearing call behaves like the single-callback form. The only deprecated names are the onCachedBannedMembers / onServerBannedMembers callback names (use the …BannedGroupMembers names).