# Function: tracked()

> 

> **tracked**\<`TData`\>(`id`, `data`): [`TrackedEnvelope`](https://trpc.io/docs/typedoc/server/index/type-aliases/TrackedEnvelope.md)\<`TData`\>

Defined in: [packages/server/src/unstable-core-do-not-import/stream/tracked.ts:46](https://github.com/trpc/trpc/blob/7c907acfd8b31929214792e3b8c2ad7a8ac72563/packages/server/src/unstable-core-do-not-import/stream/tracked.ts#L46)

Gives a subscription event an id. When the connection drops, the client
reconnects with the last id it got, as `input.lastEventId`, so the
subscription can resume from there. The id can't be empty.

## Type Parameters

| Type Parameter |
| ------ |
| `TData` |

## Parameters

| Parameter | Type |
| ------ | ------ |
| `id` | `string` |
| `data` | `TData` |

## Returns

[`TrackedEnvelope`](https://trpc.io/docs/typedoc/server/index/type-aliases/TrackedEnvelope.md)\<`TData`\>

## Example

```ts
yield tracked(post.id, post);
```

## See

https://trpc.io/docs/server/subscriptions#tracked
