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

# useMeetingSessionState

> Returns the current meeting session state as returned by meetingSessionState().

`useMeetingSessionState() : Object`

Wraps [`meetingSessionState()`](/reference/daily-js/instance-methods/meeting-session-state) and accepts a generic type parameter in TypeScript to work seamlessly with custom data type definitions.

## Parameters (optional)

An object with the following properties:

<ParamField body="onError" type="Function">
  Callback for the [`nonfatal-error` event with type `'meeting-session-data-error'`](/reference/daily-js/events/error-events#meeting-session-data-error)
</ParamField>

## Return value

An object with the following properties:

<ResponseField name="data" type="Object">
  The meeting session data
</ResponseField>

<ResponseField name="topology" type="string">
  `'none' | 'peer' | 'sfu'`, the current meeting network topology
</ResponseField>

## Example

```jsx theme={null}
import { useMeetingSessionState } from '@daily-co/daily-react';

export const UseMeetingSessionStateDemo = (props) => {
  const { data } = useMeetingSessionState();

  return (
    <div>
      <strong>Current session data:</strong>
      <pre>{JSON.stringify(data, null, 2)}</pre>
    </div>
  );
};
```

## See also

<CardGroup>
  <Card title="daily-js methods" icon="code" iconType="solid">
    * [meetingSessionState()](/reference/daily-js/instance-methods/meeting-session-state)
    * [setMeetingSessionData()](/reference/daily-js/instance-methods/set-meeting-session-data)
  </Card>

  <Card title="Events" icon="bolt" iconType="solid">
    * [nonfatal-error type meeting-session-data-error](/reference/daily-js/events/error-events#meeting-session-data-error)
  </Card>
</CardGroup>
