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:102

Methods

search(query, options): Promise<Response> Search Communities Retrieves a list of Communities matching the specified search query.

Parameters

NameTypeDescription
querystringQuery to search communities.
optionsSearchOptions & { requestOptions: { raw: true } }-

Returns

Promise<Response> Promise resolving to the API response, or raw Response if requestOptions.raw is true

Defined in

communities/client.ts:147 search(query, options?): Promise<Get2CommunitiesSearchResponse>

Parameters

NameType
querystring
options?SearchOptions

Returns

Promise<Get2CommunitiesSearchResponse>

Defined in

communities/client.ts:160

getById

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

Parameters

NameTypeDescription
idstringThe ID of the Community.
optionsGetByIdOptions & { requestOptions: { raw: true } }-

Returns

Promise<Response> Promise resolving to the API response, or raw Response if requestOptions.raw is true

Defined in

communities/client.ts:352 getById(id, options?): Promise<Get2CommunitiesIdResponse>

Parameters

NameType
idstring
options?GetByIdOptions

Returns

Promise<Get2CommunitiesIdResponse>

Defined in

communities/client.ts:365