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

# streamAppActivity

> Live activity and presence for a data app.

```typescript theme={null}
streaming.apps.streamAppActivity(request, options?) → AsyncIterable<AppActivityStreamEvent>
```

## Example

```typescript theme={null}
import { createStreamingClient } from "@textql/sdk/streaming";

const streaming = createStreamingClient({ apiKey });

for await (const event of streaming.apps.streamAppActivity({
  appId,
  afterSeq: -1n, // bigint: live-only; pass your last acked seq to catch up
})) {
  switch (event.payload.case) {
    case "activity":
      ingest(event.payload.value.records);
      break;
    case "presence":
      setPresence(event.payload.value.members);
      break;
    // "heartbeat": keepalive
  }
}
```

## Request

| Field      | Type      | Notes                                                                        |
| ---------- | --------- | ---------------------------------------------------------------------------- |
| `appId`    | `string`  | required                                                                     |
| `afterSeq` | `bigint`  | your last acked sequence number — catch-up starts here; negative = live-only |
| `scope`    | `string?` | server-side filter; empty = all scopes                                       |

## Events

| `event.payload.case` | `event.payload.value`              |
| -------------------- | ---------------------------------- |
| `"activity"`         | `{ records: AppActivityRecord[] }` |
| `"presence"`         | `{ members: AppPresenceMember[] }` |
| `"heartbeat"`        | `{}` — keepalive                   |
