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

# Sending data to your client from Layercode stream

> How to send data to your client via the Layercode stream

Sometimes you will want your Layercode stream to include additional data.

For example, you might want to update the user that the LLM is thinking or looking something up.

To do this, you can use the `stream.data` method. For example:

```ts theme={null}
stream.data({
    status: 'thinking'
})
```

And on the client side, you can receive the data you send:

```tsx theme={null}
const {

} = useLayercodeAgent({
  agentId: "your-agent-id",
  authorizeSessionEndpoint: "/api/authorize",
  onDataMessage: (data) => console.log("Received data:", data), //  {status: 'thinking'}
});
```
