tokenEncryption Readonly@beta

tokenEncryption: TokenEncryption | undefined

Custom encryption to use for the persisted refresh token cache, instead of the built-in (file-based, per-install) cipher key. For example, an Electron main-process host can supply an adapter around safeStorage.encryptString/decryptString so tokens are protected by the OS credential store (DPAPI/Keychain) rather than a key stored alongside the cache file.

@note If provided, it is the caller's responsibility to ensure the same tokenEncryption is used consistently for a given tokenStorePath; otherwise, previously cached tokens become unreadable and the user is prompted to sign in again.

Defined in

Last Updated: 27 July, 2026