# AdapTable State Key

Canonical page: https://www.adaptabletools.com/docs/getting-started-adaptable-state-key

- The AdapTable State Key is used primarily to identify the current AdapTable instance when using local storage
- But it can also be used to distinguish between multiple different remote state collections

The `adaptableStateKey` property is primarily used in conjunction with [Adaptable State](https://www.adaptabletools.com/docs/dev-guide-adaptable-state/index.md).

It is used to identify the current AdapTable instance when using [Local Storage](https://www.adaptabletools.com/docs/dev-guide-adaptable-state-persistence/index.md#local-storage)

If this is not provided, AdapTable will use the value provided in the [adaptableId](https://www.adaptabletools.com/docs/getting-started-adaptable-id/index.md) property

The property is set in the root of [Adaptable Options](https://www.adaptabletools.com/docs/technical-reference-adaptable-options/index.md).

- You can also use `adaptableStateKey` to distinguish multiple AdapTable States when using [Remote Storage](https://www.adaptabletools.com/docs/dev-guide-adaptable-state-persistence/index.md#remote-storage)
- Set it when you want the persistence identity to differ from the display [adaptableId](https://www.adaptabletools.com/docs/getting-started-adaptable-id/index.md) (for example multiple environments, or resetting stored State without renaming the Grid)

### `adaptableStateKey`

Identifier used as localStorage persistence key for AdaptableState

Set the name of the State to something identifiable

```ts {2}
const adaptableOptions: AdaptableOptions = {
    adaptableStateKey: 'myGridInstance',
} 
```

## Base Context

The value of the `adaptableStateKey` property is supplied in the very commonly used [`Base Context`](https://www.adaptabletools.com/docs/reference/basecontext.md); this is the base of the `xxxContext` properties supplied to most functions in [Adaptable Options](https://www.adaptabletools.com/docs/technical-reference-adaptable-options/index.md), and also the base of the `xxxEventInfo` object included in all [Adaptable Events](https://www.adaptabletools.com/docs/technical-reference-adaptable-events/index.md)
