InterfaceSecureLocalStorage

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.

secureLocalStorage.setItem('myLoginPassword', 'myPassword');
Editor.print("My stored password is: " + secureLocalStorage.getItem('myLoginPassword'));
secureLocalStorage.removeItem('myLoginPassword');
Editor.print("My stored password is: " + secureLocalStorage.getItem('myLoginPassword'));
interface SecureLocalStorage {
    clear(): void;
    getItem(keyName: string): string;
    getTypeName(): string;
    isOfType(type: string): boolean;
    isSame(other: ScriptObject): boolean;
    length(): number;
    removeItem(keyName: string): void;
    setItem(keyName: string, keyValue: string): void;
}

Hierarchy (view full)

Methods

  • Remove all values in the storage.

    Returns void

  • Get the value stored under keyName.

    Parameters

    • keyName: string

    Returns string

  • Get the length of the storage.

    Returns number

  • Remove the stored value under keyName.

    Parameters

    • keyName: string

    Returns void

  • Sets the value stored under keyName.

    Parameters

    • keyName: string
    • keyValue: string

    Returns void