> ## Documentation Index
> Fetch the complete documentation index at: https://docs.x.com/llms.txt
> Use this file to discover all available pages before exploring further.

# TypeScript XDK

> X API v2 向け TypeScript XDK の概要。スマートなページネーション、OAuth 1.0a、OAuth 2.0、Bearer Token 認証、リアルタイムストリーミング、完全な型安全性を備えています。

X API（旧 Twitter API）向けの包括的な TypeScript SDK です。スマートなページネーション、複数の認証方式、リアルタイムストリーミング、完全な型安全性など高度な機能を備えています。

## 主な機能

* **🔐 認証**: ユーザーコンテキスト（OAuth 1.0a、OAuth 2.0）およびアプリのみ（Bearer Token）認証
* **🔄 ページネーション**: 非同期イテレーションに対応した自動ページネーション
* **📡 ストリーミング**: 自動再接続を備えたイベント駆動型ストリーミング
* **📚 型安全性**: すべてのエンドポイントとパラメータに対する完全な TypeScript 定義
* **🎯 X API のフルサポート**: ユーザー、投稿、リスト、ブックマーク、コミュニティなど

## クイックスタート

<CodeGroup dropdown>
  ```typescript title="quickstart.ts" lines wrap icon="square-js" theme={null} theme={null}
  import { 
      Client, 
      type ClientConfig,
      type Users
  } from '@xdevplatform/xdk';

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

  const client: Client = new Client(config);

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

  main();
  ```

  ```javascript quickstart.js theme={null} theme={null}
  import { Client } from '@xdevplatform/xdk';

  const client = new Client({ bearerToken: 'your-bearer-token' });

  const userResponse = await client.users.getByUsername('XDevelopers');
  const username = userResponse.data.username;
  console.log(username);
  ```
</CodeGroup>

<Info>
  JavaScript/TypeScript XDK を使った詳細なコードサンプルは、[コードサンプル GitHub リポジトリ](https://github.com/xdevplatform/samples/tree/main/javascript)を参照してください。
</Info>

## 次に読むもの

* [インストールガイド](/xdks/typescript/install) - プロジェクトに SDK をセットアップ
* [認証](/xdks/typescript/authentication) - さまざまな認証方式について学ぶ
* [ページネーション](/xdks/typescript/pagination) - データのページネーションについて学ぶ
* [ストリーミング](/xdks/typescript/streaming) - リアルタイムデータストリーミングについて学ぶ
* [API リファレンス](/xdks/typescript/reference/classes/Client) - API ドキュメント全文を読む
