Skip to main content

SecureLocalStorage

Class

Provides encrypted storage for each plugin module's sensitive data, like access tokens.

Provides encrypted storage for each plugin module's sensitive data, like access tokens. It uses Keychain on macOS and Credentials Manager on Windows. The data can be stored and retrieved as string-to-string key value pairs via a global secureLocalStorage object. Data for each plugin module (module.json) is kept separate from all others. There is a 2KB limit on the string size because this is meant for small pieces of secure info rather than a generic container.

Index

Example

secureLocalStorage.setItem('myLoginPassword', 'myPassword');
console.log("My stored password is: " + secureLocalStorage.getItem('myLoginPassword'));
secureLocalStorage.removeItem('myLoginPassword');
console.log("My stored password is: " + secureLocalStorage.getItem('myLoginPassword'));

Extends

Methods

clear()

clear(): void

Remove all values in the storage.

Returns

void


getItem()

getItem(keyName): string

Get the value stored under keyName.

Parameters

ParameterType
keyNamestring

Returns

string


getTypeName()

static getTypeName(): string

Returns the type name of this class.

Returns

string

Overrides

ScriptObject.getTypeName


getTypeName()

getTypeName(): string

Returns the name of this object's type.

Returns

string

Inherited from

ScriptObject.getTypeName


isOfType()

isOfType(type): boolean

Returns true if the object is of the specified type.

Parameters

ParameterType
typestring

Returns

boolean

Inherited from

ScriptObject.isOfType


isSame()

isSame(other): boolean

Returns true if this object refers to the same instance as the given object.

Parameters

ParameterType
otherScriptObject

Returns

boolean

Inherited from

ScriptObject.isSame


length()

length(): number

Get the length of the storage.

Returns

number


removeItem()

removeItem(keyName): void

Remove the stored value under keyName.

Parameters

ParameterType
keyNamestring

Returns

void


setItem()

setItem(keyName, keyValue): void

Sets the value stored under keyName.

Parameters

ParameterType
keyNamestring
keyValuestring

Returns

void