> For the complete documentation index, see [llms.txt](https://stash-it.gitbook.io/stash-it/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://stash-it.gitbook.io/stash-it/api/adapter/setitem-key-value-extra.md).

# setItem(key, value, \[extra])

This method sets an item and returns it as well.

### **Arguments**

1. `key` *(string)*: A string used to store an item under.
2. `value` *(any)*: Any value that can be stored in cache. Depends on adapter you use (and storage this adapter grants access to). See [values](/stash-it/basic-structure.md#value) for more info.
3. `extra` *(object)*: It's optional. It allows you to pass additional (extra) data that you want to store alongside value. See how that can be used in lifecycle methods and plugins.

### **Returns**

*(*[*Item*](/stash-it/basic-structure.md#item)*)*: Built item, an object.

### **Example**

```javascript
// without extra
const item1 = adapter.setItem('key1', 'some value to store');

// with extra
const item2 = adapter.setItem('key2', 'some other value', { extra: 'information to store' });
```
