---
url: >-
  https://game-engine-io.github.io/enginex-frontend-sdk/reference/api/@getenginex/sdk-react/functions/useEnginex.md
---
[Reference](../../../index.md) / [@getenginex/sdk-react](../index.md) / useEnginex

# useEnginex()

> **useEnginex**(): [`EnginexClient`](../../sdk/interfaces/EnginexClient.md)

Core client given to the nearest [EnginexProvider](EnginexProvider.md).

## Returns

[`EnginexClient`](../../sdk/interfaces/EnginexClient.md)

The same `EnginexClient` passed to the provider.

## Throws

If called outside an `EnginexProvider`.

## Example

```ts
const enginex = useEnginex()
const onLogout = () => enginex.auth.logout()
```
