# CFX::GET_STATE_BAG_KEYS

- **Hash:** `0x78D864C7`
- **Namespace:** CFX
- **Runtime name (Lua/JS):** `GetStateBagKeys`
- **Side:** shared (Cfx runtime native)
- **Name status:** official
- **Documentation:** described
- **URL:** https://natives.borderlinerp.com/natives/CFX/GET_STATE_BAG_KEYS

## Signature

```c
object GET_STATE_BAG_KEYS(char* bagName);
```

## Parameters

- `bagName` (`char*`) — The name of the bag.

## Returns

`object` — Returns an array containing all keys for which the state bag has associated values.

## Usage

### Lua

```lua
local retval = GetStateBagKeys(bagName)

-- always available, by hash
local retval = Citizen.InvokeNative(0x78d864c7, bagName, Citizen.ResultAsObject2(msgpack.unpack))
```

### JavaScript

```js
const retval = GetStateBagKeys(bagName);

// by hash
const retval = Citizen.invokeNative('0x78d864c7', bagName, Citizen.returnResultAnyway(), Citizen.resultAsObject2());
```

### C#

```csharp
Function.Call((Hash)0x78d864c7, bagName);
```

*Sources: Cfx.re native reference.*
