closeHandleStorage when called, the associated HandleStorage object is removed from the cache, but data is not purged from storage.
The handleId of the handle to close a storage for.
deleteHandleStorage when called, the associated HandleStorage object is removed from the cache, and any data is purged from storage.
Used for clearing data from storage when signing out.
The handleId of the handle to delete a storage for.
useHandleStorage is responsible for opening (creating new storage or constructing object for existing storage), caching and returning HandleStorage objects for each handleId.
Each handle gets their dedicated HandleStorage object, which helps segmenting data from different sessions.
The handleId of the handle to get a storage for.
OptionalstorePassphrase: string(optional) The passphrase to use for the storage.
undefined is returned.⚠️ WARNING ⚠️
If storePassphrase is not provided when the storage handle is first created, the local storage will be UNENCRYPTED.
To enable encryption, storePassphrase must be passed on the very first call to this function — i.e., the first time this handle is initialized on a device.
⚠️ Once the storage has been initialized without encryption, it CANNOT be encrypted later by simply providing storePassphrase. Doing so will lead to storage malfunction. If this happens, you must delete the existing storage and recreate it with storePassphrase provided from the start.
The
StorageModuleis capable of managing multiple user sessions, ensuring data isolation across different handles (sessions).It should be storage-backend-agnostic to allow using the SDK in browser, Node.js or other environments with different storage requirements and capabilities.