> For the complete documentation index, see [llms.txt](https://docs.navigaglobal.com/dashboard-plugin/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.navigaglobal.com/dashboard-plugin/api-and-gui/api/store.md).

# store

## How to use

```jsx
import { Plugin } from '@root'

Plugin.store({
    ...STORE_PAYLOAD
})
```

## Store payload

| Param        | Typeof   | Default | Required | Description                                                         |
| ------------ | -------- | ------- | :------: | ------------------------------------------------------------------- |
| **key**      | String   | null    |     ✅    | the cache key to be used to save/get/remove your data from store.   |
| **data**     | Any      | null    |     ✅    | the data item to be stored.                                         |
| **callback** | Function | null    |     ❌    | a callback will be called when the data is saved/removed from store |
| **method**   | String   | GET     |     ❌    | a method to save/get/remove available methods: `GET, POST, DELETE`  |
| **personal** | Boolean  | false   |     ❌    | if true Dashboard will append the user sub to the key automatically |

## Save data to store

```jsx
import { Plugin } from '@root'

const item = {
    id: 'item-id',
    name: 'item name'
}

const onSave = () => {

}

Plugin.store({
    key: 'my-store-key',
    data: item,
    method: 'POST',
    callback: onSave
})
```

####

## Get data from store

```jsx
import { Plugin } from '@root'

const onGet = storedData => {
    console.log(storedData)
    /*
        Output:
        {
            id: 'item-id',
            name: 'item name'
        }
    */
}

Plugin.store({
    key: 'my-store-key',
    method: 'GET', // can be ignored, as GET is the default method for cache
    callback: onGet
})
```

## Remove data from store

```jsx
import { Plugin } from '@root'

Plugin.store({
    key: 'my-store-key',
    method: 'DELETE'
})
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.navigaglobal.com/dashboard-plugin/api-and-gui/api/store.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
