Class: KeyValueStore

api. KeyValueStore

Abstract class for a Key-Value store. The Channel class uses this store to save sensitive information such as authenticated user's private keys, certificates, etc. The SDK provides a default implementation based on files. An alternative implementation can be specified using the "key-value-store" configuration setting, pointing to a full require() path to package for the module.

new KeyValueStore()

Methods


getValue(name)

Get the value associated with name.
Parameters:
Name Type Description
name string Name of the key
Returns:
Promise for the value corresponding to the key. If the value does not exist in the store, returns null without rejecting the promise
Type
Promise

setValue(name, value)

Set the value associated with name.
Parameters:
Name Type Description
name string Name of the key to save
value string The Value to save
Returns:
Promise for the 'value' object upon successful write operation
Type
Promise