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

# useSession

[API Reference](/api-reference/modelence/client/functions/../../../index) / [modelence](/api-reference/modelence/client/functions/../../index) / [client](/api-reference/modelence/client/functions/../index) / useSession

> **useSession**(): `object`

Defined in: [packages/modelence/src/client/session.ts:130](https://github.com/modelence/modelence/blob/dcea4170315a023a7e8f0c3c5d551c26b7adecf3/packages/modelence/src/client/session.ts#L130)

`useSession` is a hook that returns the current user, and in the future will also return other details about the current session.

## Example

```ts theme={null}
import { useSession } from 'modelence/client';

function MyComponent() {
  const { user } = useSession();
  return <div>{user?.handle}</div>;
}
```

## Returns

`object`

| Name   | Type             | Defined in                                                                                                                                                                         |
| ------ | ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `user` | `null` \| `User` | [packages/modelence/src/client/session.ts:132](https://github.com/modelence/modelence/blob/dcea4170315a023a7e8f0c3c5d551c26b7adecf3/packages/modelence/src/client/session.ts#L132) |
