Optional retryConfig: Partial<RetryConfig>Initialize the adapter with auth credentials. If already connected this will shut down the existing connection first (idempotent).
Get the current connection status and metadata.
Send a message to a conversation on the external platform.
Platform-native conversation/chat ID.
Message content to send.
The platform-assigned message ID.
Register an event handler. Returns an unsubscribe function.
Optional eventTypes: ChannelEventType[]Protected emitEmit an event to all matching subscribers. Subclasses call this when the platform SDK receives an inbound event.
Protected emitConvenience helper: emit a connection_change event with the current
status. Called automatically by setStatus.
Protected hasCheck whether this adapter declares a specific capability.
Protected setTransition to a new connection status and emit an event.
Optional error: stringProtected doEstablish the platform connection using the supplied credentials.
Called by initialize after state has been set to connecting.
Must throw on failure — the base class handles retry and state changes.
Protected doDeliver a message to the external platform.
Called by sendMessage only when the adapter is connected.
Protected doRelease platform resources (close WebSocket, stop polling, etc.).
Called by shutdown before the state transitions to disconnected.
Post a tweet (public timeline post).
Message content to tweet.
Optional replyToTweetId: stringIf provided, the tweet will be a reply in a thread.
Post a thread (sequence of connected tweets).
Protected statusProtected connectedProtected errorProtected platformProtected authStored auth config so reconnect() can re-use it.
Protected Readonly retryReadonly platformPlatform this adapter serves.
Readonly displayHuman-readable display name (e.g., "WhatsApp Business").
Readonly capabilitiesDeclared capabilities of this adapter.
Channel adapter for Twitter / X.
Uses the
twitter-api-v2package via dynamic import so the dependency is optional -- it is only loaded at connection time.Capabilities:
text,images,video,hashtags,mentions,threads,reactions,polls.