---
url: /reference/localstorage.md
---

# @signaldb/localstorage

## createLocalStorageAdapter (`default`)

```js
import createLocalStorageAdapter from '@signaldb/localstorage'
import { Collection } from '@signaldb/core'

const collection = new Collection({
  persistence: createLocalStorageAdapter('posts'),
})
```

Function to create a localStorage adapter for use with a collection.
The localStorage Adapter is the most straightforward tool for usage within a browser setting. To initiate its use, the only step required is designating a specific name to identify your data. This named data forms a collection that will be stored in the localStorage, from which it can be loaded or saved as needed.
