private-local-storage
v1.0.2
Published
Store data in local storage securily
Downloads
2
Maintainers
Readme
Private Local storage
Store data in local storage securily
Usage/Examples
import { PrivateLocalStorage } from "private-local-storage";
let SecureStorage = new PrivateLocalStorage({
privateKey: "abcd1234#$",
});
function App() {
handleSetItemClick = () => {
SecureStorage.setItem("somekey", 'someValue)
}
return<button onClick={this.handleSetItemClick}>Set Item</button>
}
Available Methods
Get item
SecureStorage.getItem()
| Parameter | Type | Description |
| :-------- | :------- | :---------------------------------------- |
| key
| string
| Required. Your local storage item key |
.getItem(key)
Set item
SecureStorage.setItem()
| Parameter | Type | Description |
| :-------- | :------- | :------------------------------------------ |
| key
| string
| Required. Your local storage item key |
| value
| any
| Required. Your local storage item value |
.setItem(key, value)
Delete item
SecureStorage.deleteItem()
| Parameter | Type | Description |
| :-------- | :------- | :---------------------------------------- |
| key
| string
| Required. Your local storage item key |