# 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/57482b0bb09dce5c838dc8bf5727a943488bac61/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
