Skip to main content
Client for communities operations This client provides methods for interacting with the communities endpoints of the X API. It handles authentication, request formatting, and response parsing for all communities related operations.

Constructors

constructor

new CommunitiesClient(client): CommunitiesClient Creates a new communities client instance

Parameters

NameTypeDescription
clientClientThe main X API client instance

Returns

CommunitiesClient

Defined in

communities/client.ts:68

Methods

getById

getById(id, options?): Promise<Get2CommunitiesIdResponse> Get Community by ID Retrieves details of a specific Community by its ID.

Parameters

NameTypeDescription
idstringThe ID of the Community.
optionsGetByIdOptions-

Returns

Promise<Get2CommunitiesIdResponse> Promise resolving to the API response

Defined in

communities/client.ts:85
search(query, options?): Promise<Get2CommunitiesSearchResponse> Search Communities Retrieves a list of Communities matching the specified search query.

Parameters

NameTypeDescription
querystringQuery to search communities.
optionsSearchOptions-

Returns

Promise<Get2CommunitiesSearchResponse> Promise resolving to the API response

Defined in

communities/client.ts:135