A Swift library for securely storing data in the Apple Keychain across iOS, macOS, tvOS, and watchOS with a simple API.
Valet is a Swift library that simplifies secure data storage on Apple platforms by providing an easy-to-use abstraction over the Apple Keychain. It allows developers to store sensitive information like passwords and tokens without needing to understand the underlying Keychain APIs, handling complexities like accessibility levels, iCloud syncing, and Secure Enclave integration automatically. The library ensures data is stored securely while offering a clean, type-safe interface for iOS, macOS, tvOS, and watchOS apps.
iOS, macOS, tvOS, and watchOS developers who need to securely store sensitive data like authentication tokens, passwords, or encryption keys in their apps without dealing with low-level Keychain APIs.
Developers choose Valet because it drastically reduces the complexity and boilerplate code required for Keychain interactions, provides thread-safe operations, and supports advanced features like cross-device syncing and biometric protection out of the box. It’s maintained by Square, ensuring reliability and adherence to Apple’s security best practices.
Valet lets you securely store data in the iOS, tvOS, watchOS, or macOS Keychain without knowing a thing about how the Keychain works. It’s easy. We promise.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Provides straightforward methods like setString and string(forKey) for storing and retrieving data, abstracting away complex Keychain APIs with minimal code, as shown in the basic usage examples.
Works seamlessly across iOS, tvOS, watchOS, and macOS with consistent behavior, ensuring developers can use the same library on all Apple platforms without platform-specific tweaks.
Leverages Secure Enclave for biometric protection (Face ID/Touch ID) and supports iCloud syncing via iCloud Keychain, enabling high-security storage and cross-device sharing out of the box.
Includes utilities like migrateObjects to transition existing Keychain entries into Valet and between accessibility settings, easing adoption from legacy Keychain code.
Requires the Keychain Sharing entitlement on macOS even for apps not sharing data, and needs manual migration for pre-Catalina systems via migrateObjectsFromPreCatalina(), adding setup complexity.
Xcode debugging can cause keychain access failures due to improper signing or debugger attachments, requiring workarounds like running without a debugger, which disrupts development flow.
Tied exclusively to Apple platforms with no support for server-side or cross-ecosystem key management, limiting use in hybrid or non-Apple environments.