You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
🧁 SweetCookieKit — Native macOS cookie extraction for Safari, Chromium, and Firefox.
SweetCookieKit is a Swift 6 package for extracting browser cookies on macOS.
It supports Safari, Chromium-based browsers, and Firefox, and provides a modern API
for selecting browsers and profiles, filtering by domain, and converting results to
HTTPCookie values.
letorder=Browser.defaultImportOrder // tries all supported browsers by default
forbrowserin order {letresults=try client.records(matching: query, in: browser)
// results are grouped per profile/store
}
Example CLI
See Examples/CookieCLI for a standalone SwiftPM executable that lists stores and exports cookies as JSON or HTTP headers.
cd Examples/CookieCLI
swift run SweetCookieCLI --help
Notes
Safari cookie access may require Full Disk Access.
Chromium imports can trigger a Keychain prompt for "Chrome Safe Storage".
To explain keychain prompts before they appear, set a preflight handler:
import SweetCookieKit
BrowserCookieKeychainPromptHandler.shared.handler ={ context in
// Show a blocking alert or custom UI before the system prompt appears.
// context.kind = .chromiumSafeStorage
}
This package does not persist cookies. It only reads and returns them.