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

# enginexKeys

> `const` **enginexKeys**: [`EnginexKeys`](../interfaces/EnginexKeys.md)

Prefixes of the SDK's query keys (see [EnginexQueryKey](../type-aliases/EnginexQueryKey.md)). The fixed prefixes are frozen.

The `['enginex', 'user', userId, namespace, method, input?]` layout is a contract. For `setQueryData`,
the exact key is the factory's (`q.wallet.getBalance().queryKey`), not the prefix.

## Example

```ts
import { enginexKeys } from '@getenginex/sdk/query'

// After logout or a user switch: nothing from the previous user stays in the cache.
queryClient.removeQueries({ queryKey: enginexKeys.user() })
// Everything for the current player.
queryClient.invalidateQueries({ queryKey: enginexKeys.user(session.userId) })
// Only the wallet, or only the balance.
queryClient.invalidateQueries({ queryKey: enginexKeys.user(session.userId, 'wallet') })
queryClient.invalidateQueries({ queryKey: enginexKeys.user(session.userId, 'wallet', 'getBalance') })
// Exact key for setQueryData: the factory's.
queryClient.setQueryData(createQueries(client).wallet.getBalance().queryKey, balance)
```
