Skip to main content
A comprehensive TypeScript SDK for the X API (formerly Twitter API) with advanced features including smart pagination, multiple authentication methods, real-time streaming, and full type safety.

Key Features

  • πŸ” Authentication: User Context (OAuth1.0a, OAuth2.0), and App-Only (Bearer token) authentication
  • πŸ”„ Pagination: Automatic pagination with async iteration support
  • πŸ“‘ Streaming: Event-driven streaming with automatic reconnection
  • πŸ“š Type Safety: Complete TypeScript definitions for all endpoints and parameters
  • 🎯 Full X API Support: Users, Posts, Lists, Bookmarks, Communities, and more

Quick Start

quickstart.ts
import { 
  Client, 
  type ClientConfig,
  type UsersGetByUsernameResponse
} from '@xdevplatform/xdk';

const config: ClientConfig = { bearerToken: 'your-bearer-token' };

const client: Client = new Client(config);

async function main(): Promise<void> {
  const userResponse: UsersGetByUsernameResponse = await client.users.getByUsername('XDevelopers');
  const username: string = userResponse.data?.username!;
  console.log(username);
}

main();

What’s Next?