> ## 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.

# CommunitiesClient

> X API TypeScript SDK의 CommunitiesClient 클래스에 대한 레퍼런스. X API v2 communities 엔드포인트에 대한 메서드, 매개변수 및 반환 타입.

communities 작업을 위한 클라이언트

이 클라이언트는 X API의 communities 엔드포인트와 상호작용하기 위한 메서드를
제공합니다. 모든 communities 관련 작업에 대한 인증, 요청 형식화 및 응답
파싱을 처리합니다.

## 생성자

### constructor

• **new CommunitiesClient**(`client`): [`CommunitiesClient`](/xdks/typescript/reference/classes/CommunitiesClient)

새 communities 클라이언트 인스턴스를 생성합니다

#### 매개변수

| 이름       | 타입                                                    | 설명                  |
| :------- | :---------------------------------------------------- | :------------------ |
| `client` | [`Client`](/xdks/typescript/reference/classes/Client) | 메인 X API 클라이언트 인스턴스 |

#### 반환값

[`CommunitiesClient`](/xdks/typescript/reference/classes/CommunitiesClient)

#### 정의 위치

[communities/client.ts:102](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/communities/client.ts#L102)

## 메서드

### search

▸ **search**(`query`, `options`): `Promise`\<`Response`>

Search Communities
지정된 검색 쿼리와 일치하는 Communities 목록을 검색합니다.

#### 매개변수

| 이름        | 타입                                                            | 설명                      |
| :-------- | :------------------------------------------------------------ | :---------------------- |
| `query`   | `string`                                                      | communities를 검색할 쿼리입니다. |
| `options` | `SearchOptions` & \{ `requestOptions`: \{ `raw`: `true`  }  } | -                       |

#### 반환값

`Promise`\<`Response`>

API 응답 또는 requestOptions.raw가 true인 경우 원본 Response로 해결되는 Promise

#### 정의 위치

[communities/client.ts:147](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/communities/client.ts#L147)

▸ **search**(`query`, `options?`): `Promise`\<[`Get2CommunitiesSearchResponse`](/xdks/typescript/reference/interfaces/Schemas.Get2CommunitiesSearchResponse)>

#### 매개변수

| 이름         | 타입              |
| :--------- | :-------------- |
| `query`    | `string`        |
| `options?` | `SearchOptions` |

#### 반환값

`Promise`\<[`Get2CommunitiesSearchResponse`](/xdks/typescript/reference/interfaces/Schemas.Get2CommunitiesSearchResponse)>

#### 정의 위치

[communities/client.ts:160](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/communities/client.ts#L160)

***

### getById

▸ **getById**(`id`, `options`): `Promise`\<`Response`>

Get Community by ID
ID로 특정 Community의 세부 정보를 검색합니다.

#### 매개변수

| 이름        | 타입                                                             | 설명                |
| :-------- | :------------------------------------------------------------- | :---------------- |
| `id`      | `string`                                                       | Community의 ID입니다. |
| `options` | `GetByIdOptions` & \{ `requestOptions`: \{ `raw`: `true`  }  } | -                 |

#### 반환값

`Promise`\<`Response`>

API 응답 또는 requestOptions.raw가 true인 경우 원본 Response로 해결되는 Promise

#### 정의 위치

[communities/client.ts:352](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/communities/client.ts#L352)

▸ **getById**(`id`, `options?`): `Promise`\<[`Get2CommunitiesIdResponse`](/xdks/typescript/reference/interfaces/Schemas.Get2CommunitiesIdResponse)>

#### 매개변수

| 이름         | 타입               |
| :--------- | :--------------- |
| `id`       | `string`         |
| `options?` | `GetByIdOptions` |

#### 반환값

`Promise`\<[`Get2CommunitiesIdResponse`](/xdks/typescript/reference/interfaces/Schemas.Get2CommunitiesIdResponse)>

#### 정의 위치

[communities/client.ts:365](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/communities/client.ts#L365)
