Something went wrong. Try again.
A decentralized music tracking and discovery platform built on AT Protocol 🎵 rocksky.app
spotify atproto lastfm musicbrainz scrobbling listenbrainz
Something went wrong. Try again.
123456789101112131415161718import fs from "fs";import os from "os";import path from "path";
/** * Reads the session token saved by `rocksky login` from * `~/.rocksky/token.json`. Returns undefined when the user is not logged in. */export function loadToken(): string | undefined { try { const tokenPath = path.join(os.homedir(), ".rocksky", "token.json"); const { token } = JSON.parse(fs.readFileSync(tokenPath, "utf-8")); return token || undefined; } catch { return undefined; }}