AI-native knowledge base & Evernote/Obsidian alternative with instant sync & native MCP. Free on Cloudflare or self-hosted via Docker.
HTML ai-agentcloudflarecloudflare-d1cloudflare-r2cloudflare-workersdockerelectronevernoteevernote-alternativeknowledge-basemcpnote-takingobsidian-alternativeoffline-firstpersonal-knowledge-basepwaself-hostedsqlitetiptapweb-clipper
import Foundation
enum DeviceId {
/// Stable per-install device id sent with login (`deviceId`), matching RN `edgeever.mobile.device-id`.
static func getOrCreate() throws -> String {
if let existing = try KeychainStore.string(forKey: KeychainStore.Key.deviceId), !existing.isEmpty {
return existing
}
let id = "mobile-\(UUID().uuidString.lowercased())"
try KeychainStore.setString(id, forKey: KeychainStore.Key.deviceId)
return id
}
}