Skip to content

YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context

fix: shorten auto-generated API key to sp-{8 chars}

Louis Beaumont87173f79b7ad
diff --git a/apps/screenpipe-app-tauri/src-tauri/src/store.rs b/apps/screenpipe-app-tauri/src-tauri/src/store.rs
index a596c45f6..8404135a8 100644
--- a/apps/screenpipe-app-tauri/src-tauri/src/store.rs
+++ b/apps/screenpipe-app-tauri/src-tauri/src/store.rs
@@ -913,7 +913,7 @@ impl SettingsStore {
// Auto-generate if no key found — stored in the encrypted settings
// store (not auth.json) so it's protected by keychain encryption.
if config.api_auth_key.is_none() {
- let key = format!("sp-{}", uuid::Uuid::new_v4().simple());
+ let key = format!("sp-{}", &uuid::Uuid::new_v4().simple().to_string()[..8]);
tracing::info!("api auth enabled — auto-generated key");
config.api_auth_key = Some(key);
// Note: caller should persist this back to settings.apiKey
diff --git a/crates/screenpipe-engine/src/cli/mod.rs b/crates/screenpipe-engine/src/cli/mod.rs
index 6d5874eb8..b11fd7d54 100644
--- a/crates/screenpipe-engine/src/cli/mod.rs
+++ b/crates/screenpipe-engine/src/cli/mod.rs
@@ -539,7 +539,7 @@ impl RecordArgs {
// Auto-generate if none found — persist to secret store
if config.api_auth_key.is_none() {
- let key = format!("sp-{}", uuid::Uuid::new_v4().simple());
+ let key = format!("sp-{}", &uuid::Uuid::new_v4().simple().to_string()[..8]);
if let Ok(store) = auth::open_secret_store().await {
let _ = store.set("api_auth_key", key.as_bytes()).await;
}