Socket
Socket
Sign inDemoInstall

@meniga/storage

Package Overview
Dependencies
Maintainers
0
Versions
94
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@meniga/storage

A library to use local and session storage securely


Version published
Maintainers
0
Created
Source

@meniga/storage

Storage is a utility library for saving information in local and session storage and uses the store2 and shared-session-storage dependencies.

Configuration


Default store

The default store used is the sessionStorage, but you can specify to use localStorage by default if you prefer.

Use the auth config to do that by setting useLocalStorage to true.

Multitab support

If you want to include multitab support when using session storage, set useSharedSessionStorage to true in the auth.js config.

Note: Multitab support is only needed when not using cookie-based authentication, such as the Meniga STS authentication service.

Example:

{
	auth: {
		useLocalStorage: false,
		useSharedSessionStorage: true,
	}
}

API


The getItem, setItem, removeItem and clearStorage methods work with the store set as default, while getLocalItem and getSessionItem (et al) work on specific stores.

Full list of API methods:

  • getItem ( key )
  • getLocalItem ( key )
  • getSessionItem ( key )
  • setItem ( key, value )
  • setLocalItem ( key, value )
  • setSessionItem ( key, value )
  • removeItem ( key )
  • removeLocalItem ( key )
  • removeSessionItem ( key )
  • clearStorage ()
  • clearLocalStorage ()
  • clearSessionStorage ()

FAQs

Package last updated on 26 Sep 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc