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

# StreamClient

> Reference for the StreamClient class in the X API TypeScript SDK. Methods, parameters, and return types for the X API v2 stream endpoints.

## Constructors

### constructor

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

#### Parameters

| Name     | Type                                                  |
| :------- | :---------------------------------------------------- |
| `client` | [`Client`](/xdks/typescript/reference/classes/Client) |

#### Returns

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

#### Defined in

[stream/stream\_client.ts:972](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/stream/stream_client.ts#L972)

## Methods

### likesCompliance

▸ **likesCompliance**(`options?`): `Promise`\<`EventDrivenStream`>

Stream Likes compliance data
Streams all compliance data related to Likes for Users.

Returns an event-driven stream that's easy to use.
Use .on() to listen for events like 'data', 'error', 'close'.
Also supports async iteration with for await...of.

#### Parameters

| Name      | Type                              |
| :-------- | :-------------------------------- |
| `options` | `LikesComplianceStreamingOptions` |

#### Returns

`Promise`\<`EventDrivenStream`>

Event-driven stream for handling streaming data

#### Defined in

[stream/stream\_client.ts:1016](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/stream/stream_client.ts#L1016)

***

### usersCompliance

▸ **usersCompliance**(`partition`, `options?`): `Promise`\<`EventDrivenStream`>

Stream Users compliance data
Streams all compliance data related to Users.

Returns an event-driven stream that's easy to use.
Use .on() to listen for events like 'data', 'error', 'close'.
Also supports async iteration with for await...of.

#### Parameters

| Name        | Type                              | Description           |
| :---------- | :-------------------------------- | :-------------------- |
| `partition` | `number`                          | The partition number. |
| `options`   | `UsersComplianceStreamingOptions` | -                     |

#### Returns

`Promise`\<`EventDrivenStream`>

Event-driven stream for handling streaming data

#### Defined in

[stream/stream\_client.ts:1196](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/stream/stream_client.ts#L1196)

***

### postsFirehoseKo

▸ **postsFirehoseKo**(`partition`, `options?`): `Promise`\<`EventDrivenStream`>

Stream Korean Posts
Streams all public Korean-language Posts in real-time.

Returns an event-driven stream that's easy to use.
Use .on() to listen for events like 'data', 'error', 'close'.
Also supports async iteration with for await...of.

#### Parameters

| Name        | Type                              | Description           |
| :---------- | :-------------------------------- | :-------------------- |
| `partition` | `number`                          | The partition number. |
| `options`   | `PostsFirehoseKoStreamingOptions` | -                     |

#### Returns

`Promise`\<`EventDrivenStream`>

Event-driven stream for handling streaming data

#### Defined in

[stream/stream\_client.ts:1392](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/stream/stream_client.ts#L1392)

***

### likesSample10

▸ **likesSample10**(`partition`, `options?`): `Promise`\<`EventDrivenStream`>

Stream sampled Likes
Streams a 10% sample of public Likes in real-time.

Returns an event-driven stream that's easy to use.
Use .on() to listen for events like 'data', 'error', 'close'.
Also supports async iteration with for await...of.

#### Parameters

| Name        | Type                            | Description           |
| :---------- | :------------------------------ | :-------------------- |
| `partition` | `number`                        | The partition number. |
| `options`   | `LikesSample10StreamingOptions` | -                     |

#### Returns

`Promise`\<`EventDrivenStream`>

Event-driven stream for handling streaming data

#### Defined in

[stream/stream\_client.ts:1706](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/stream/stream_client.ts#L1706)

***

### likesFirehose

▸ **likesFirehose**(`partition`, `options?`): `Promise`\<`EventDrivenStream`>

Stream all Likes
Streams all public Likes in real-time.

Returns an event-driven stream that's easy to use.
Use .on() to listen for events like 'data', 'error', 'close'.
Also supports async iteration with for await...of.

#### Parameters

| Name        | Type                            | Description           |
| :---------- | :------------------------------ | :-------------------- |
| `partition` | `number`                        | The partition number. |
| `options`   | `LikesFirehoseStreamingOptions` | -                     |

#### Returns

`Promise`\<`EventDrivenStream`>

Event-driven stream for handling streaming data

#### Defined in

[stream/stream\_client.ts:1983](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/stream/stream_client.ts#L1983)

***

### postsFirehoseJa

▸ **postsFirehoseJa**(`partition`, `options?`): `Promise`\<`EventDrivenStream`>

Stream Japanese Posts
Streams all public Japanese-language Posts in real-time.

Returns an event-driven stream that's easy to use.
Use .on() to listen for events like 'data', 'error', 'close'.
Also supports async iteration with for await...of.

#### Parameters

| Name        | Type                              | Description           |
| :---------- | :-------------------------------- | :-------------------- |
| `partition` | `number`                          | The partition number. |
| `options`   | `PostsFirehoseJaStreamingOptions` | -                     |

#### Returns

`Promise`\<`EventDrivenStream`>

Event-driven stream for handling streaming data

#### Defined in

[stream/stream\_client.ts:2257](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/stream/stream_client.ts#L2257)

***

### postsFirehoseEn

▸ **postsFirehoseEn**(`partition`, `options?`): `Promise`\<`EventDrivenStream`>

Stream English Posts
Streams all public English-language Posts in real-time.

Returns an event-driven stream that's easy to use.
Use .on() to listen for events like 'data', 'error', 'close'.
Also supports async iteration with for await...of.

#### Parameters

| Name        | Type                              | Description           |
| :---------- | :-------------------------------- | :-------------------- |
| `partition` | `number`                          | The partition number. |
| `options`   | `PostsFirehoseEnStreamingOptions` | -                     |

#### Returns

`Promise`\<`EventDrivenStream`>

Event-driven stream for handling streaming data

#### Defined in

[stream/stream\_client.ts:2571](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/stream/stream_client.ts#L2571)

***

### postsSample

▸ **postsSample**(`options?`): `Promise`\<`EventDrivenStream`>

Stream sampled Posts
Streams a 1% sample of public Posts in real-time.

Returns an event-driven stream that's easy to use.
Use .on() to listen for events like 'data', 'error', 'close'.
Also supports async iteration with for await...of.

#### Parameters

| Name      | Type                          |
| :-------- | :---------------------------- |
| `options` | `PostsSampleStreamingOptions` |

#### Returns

`Promise`\<`EventDrivenStream`>

Event-driven stream for handling streaming data

#### Defined in

[stream/stream\_client.ts:2887](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/stream/stream_client.ts#L2887)

***

### postsSample10

▸ **postsSample10**(`partition`, `options?`): `Promise`\<`EventDrivenStream`>

Stream 10% sampled Posts
Streams a 10% sample of public Posts in real-time.

Returns an event-driven stream that's easy to use.
Use .on() to listen for events like 'data', 'error', 'close'.
Also supports async iteration with for await...of.

#### Parameters

| Name        | Type                            | Description           |
| :---------- | :------------------------------ | :-------------------- |
| `partition` | `number`                        | The partition number. |
| `options`   | `PostsSample10StreamingOptions` | -                     |

#### Returns

`Promise`\<`EventDrivenStream`>

Event-driven stream for handling streaming data

#### Defined in

[stream/stream\_client.ts:3145](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/stream/stream_client.ts#L3145)

***

### postsCompliance

▸ **postsCompliance**(`partition`, `options?`): `Promise`\<`EventDrivenStream`>

Stream Posts compliance data
Streams all compliance data related to Posts.

Returns an event-driven stream that's easy to use.
Use .on() to listen for events like 'data', 'error', 'close'.
Also supports async iteration with for await...of.

#### Parameters

| Name        | Type                              | Description           |
| :---------- | :-------------------------------- | :-------------------- |
| `partition` | `number`                          | The partition number. |
| `options`   | `PostsComplianceStreamingOptions` | -                     |

#### Returns

`Promise`\<`EventDrivenStream`>

Event-driven stream for handling streaming data

#### Defined in

[stream/stream\_client.ts:3459](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/stream/stream_client.ts#L3459)

***

### labelsCompliance

▸ **labelsCompliance**(`options?`): `Promise`\<`EventDrivenStream`>

Stream Post labels
Streams all labeling events applied to Posts.

Returns an event-driven stream that's easy to use.
Use .on() to listen for events like 'data', 'error', 'close'.
Also supports async iteration with for await...of.

#### Parameters

| Name      | Type                               |
| :-------- | :--------------------------------- |
| `options` | `LabelsComplianceStreamingOptions` |

#### Returns

`Promise`\<`EventDrivenStream`>

Event-driven stream for handling streaming data

#### Defined in

[stream/stream\_client.ts:3651](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/stream/stream_client.ts#L3651)

***

### posts

▸ **posts**(`options?`): `Promise`\<`EventDrivenStream`>

Stream filtered Posts
Streams Posts in real-time matching the active rule set.

Returns an event-driven stream that's easy to use.
Use .on() to listen for events like 'data', 'error', 'close'.
Also supports async iteration with for await...of.

#### Parameters

| Name      | Type                    |
| :-------- | :---------------------- |
| `options` | `PostsStreamingOptions` |

#### Returns

`Promise`\<`EventDrivenStream`>

Event-driven stream for handling streaming data

#### Defined in

[stream/stream\_client.ts:3827](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/stream/stream_client.ts#L3827)

***

### postsFirehose

▸ **postsFirehose**(`partition`, `options?`): `Promise`\<`EventDrivenStream`>

Stream all Posts
Streams all public Posts in real-time.

Returns an event-driven stream that's easy to use.
Use .on() to listen for events like 'data', 'error', 'close'.
Also supports async iteration with for await...of.

#### Parameters

| Name        | Type                            | Description           |
| :---------- | :------------------------------ | :-------------------- |
| `partition` | `number`                        | The partition number. |
| `options`   | `PostsFirehoseStreamingOptions` | -                     |

#### Returns

`Promise`\<`EventDrivenStream`>

Event-driven stream for handling streaming data

#### Defined in

[stream/stream\_client.ts:4125](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/stream/stream_client.ts#L4125)

***

### postsFirehosePt

▸ **postsFirehosePt**(`partition`, `options?`): `Promise`\<`EventDrivenStream`>

Stream Portuguese Posts
Streams all public Portuguese-language Posts in real-time.

Returns an event-driven stream that's easy to use.
Use .on() to listen for events like 'data', 'error', 'close'.
Also supports async iteration with for await...of.

#### Parameters

| Name        | Type                              | Description           |
| :---------- | :-------------------------------- | :-------------------- |
| `partition` | `number`                          | The partition number. |
| `options`   | `PostsFirehosePtStreamingOptions` | -                     |

#### Returns

`Promise`\<`EventDrivenStream`>

Event-driven stream for handling streaming data

#### Defined in

[stream/stream\_client.ts:4439](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/stream/stream_client.ts#L4439)

***

### getRuleCounts

▸ **getRuleCounts**(`options?`): `Promise`\<[`Get2TweetsSearchStreamRulesCountsResponse`](/xdks/typescript/reference/interfaces/Schemas.Get2TweetsSearchStreamRulesCountsResponse)>

Get stream rule counts
Retrieves the count of rules in the active rule set for the filtered stream.

#### Parameters

| Name      | Type                            |
| :-------- | :------------------------------ |
| `options` | `GetRuleCountsStreamingOptions` |

#### Returns

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

Promise with the API response

#### Defined in

[stream/stream\_client.ts:4753](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/stream/stream_client.ts#L4753)

***

### getRules

▸ **getRules**(`options?`): `Promise`\<[`RulesLookupResponse`](/xdks/typescript/reference/interfaces/Schemas.RulesLookupResponse)>

Get stream rules
Retrieves the active rule set or a subset of rules for the filtered stream.

#### Parameters

| Name      | Type                       |
| :-------- | :------------------------- |
| `options` | `GetRulesStreamingOptions` |

#### Returns

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

Promise with the API response

#### Defined in

[stream/stream\_client.ts:4854](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/stream/stream_client.ts#L4854)

***

### updateRules

▸ **updateRules**(`body`, `options?`): `Promise`\<[`AddOrDeleteRulesResponse`](/xdks/typescript/reference/interfaces/Schemas.AddOrDeleteRulesResponse)>

Update stream rules
Adds or deletes rules from the active rule set for the filtered stream.

#### Parameters

| Name      | Type                          |
| :-------- | :---------------------------- |
| `body`    | `any`                         |
| `options` | `UpdateRulesStreamingOptions` |

#### Returns

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

Promise with the API response

#### Defined in

[stream/stream\_client.ts:4987](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/stream/stream_client.ts#L4987)
