Skip to content

Operating Modes

The SDK supports three operating modes for different use cases.

Hybrid Mode (Default)

Automatically switches between scraping and API:

typescript
const client = new XTwitterClient({
  mode: 'hybrid',
  preferredMode: 'crawler' // Try scraping first
});

Best for: Flexibility and reliability

API Mode

Uses only the official Twitter API:

typescript
const client = new XTwitterClient({
  mode: 'api'
});

Best for: Guaranteed compatibility, write operations

Crawler Mode

Uses only web scraping:

typescript
const client = new XTwitterClient({
  mode: 'crawler'
});

Best for: Read-only operations, higher volume

Choosing a Mode

ModeRead OperationsWrite OperationsFallback
HybridScraping → APIAPIYes
APIAPIAPINo
CrawlerScrapingNot supportedNo

Next Steps

Released under the MIT License.