Stable device ID for browser sign-in with fallback on I/O failure
// Source: https://github.com/prapaa-ai/agav | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
import { readFile, writeFile, rename, rm } from "node:fs/promises";
import { homedir, hostname } from "node:os";
import { join } from "node:path";
import { randomBytes } from "node:crypto";
import { withAccountLock } from "./account-lock.js";
/**
* Stable per-install DEVICE IDENTITY for browser sign-in.
*
* The account service rotates browser sign-in keys per device and caps the number
* of devices per account. To make that work, the CLI sends a stable, opaque id
* that identifies THIS installation across logins, plus a friendly label for the
* dashboard. The id is:
* - NOT a sec
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key