Map<String, dynamic> toJson() { return { 'isLocalStorage': isLocalStorage, if (securityOrigin != null) 'securityOrigin': securityOrigin, if (storageKey != null) 'storageKey': storageKey!.toJson(), }; }