How to Use npx hyperframes auth login

Sign in to HeyGen with HyperFrames OAuth, device login, or an API key, and use auth status to check which credential will be used for hosted work.

Updated Dec 4, 2026 · Tested with HyperFrames 0.10.10

Use npx hyperframes auth login when a command needs your HeyGen identity. Common examples are sending a render to HeyGen's cloud, uploading a review share, or using a feature that calls HeyGen for media. A local init, preview, lint, check, or render of your own composition can run without signing in. If you arrived here while trying to make a first MP4, the install guide takes you through that workflow.

  • Desktop terminal with a browser. Use browser OAuth via auth login.
  • Human-operated SSH or headless machine. Use device flow via auth login --device.
  • CI for an authorized hosted operation. Inject HEYGEN_API_KEY as a job secret, or use --api-key with stdin when you need a saved key.
  • Local preview and local export. Run the local commands directly.

Browser OAuth on your desktop

bash
npx hyperframes auth login
npx hyperframes auth status

The CLI starts an OAuth flow and opens the authorization page in your browser. Sign into the intended HeyGen account and approve the request. The browser returns to a callback on the same machine as the terminal. Leave the command open until it finishes. Then use auth status to check the active credential source and identity before uploading or submitting a hosted job.

A browser session already signed into HeyGen can select an account you did not intend to use. Check the account on the consent page. If you approve the wrong one, sign out locally and select the intended account in the browser before retrying. Local HyperFrames sign-out does not switch the browser's own HeyGen account.

Device flow for SSH

bash
npx hyperframes auth login --device
npx hyperframes auth status

Run the login on the machine that will actually use the credential. Open the verification URL shown in that terminal in a browser you control. If a separate code appears, enter it on the verification page and approve the request. Return to the waiting terminal. The verified login is saved on the SSH machine, so check status there. Treat the URL and code as private while they are active.

Choose this path if a desktop browser cannot reach the callback on the machine where the CLI is running. If the code expires, start a fresh device login and finish the approval while that command is waiting. CI intentionally refuses --device. If a job needs only local render, remove the login step. If it needs a hosted operation, use a job credential.

API keys in automation

Inject HEYGEN_API_KEY from your CI system's secrets into the job environment. For a short-lived job, the CLI can read it directly. If your workflow needs to persist it within a deliberately isolated runtime, pass the key on standard input. This example assumes the CI system already provided the variable.

bash
printf '%s\n' "$HEYGEN_API_KEY" | npx hyperframes auth login --api-key
npx hyperframes auth status

Use a shell without command tracing for the secret-handling step. Passing the value as a literal argument can expose it through shell history or process inspection. On a desktop, npx hyperframes auth login --api-key by itself can prompt for the key. The login validates the key with HeyGen before saving it. A CI job that needs only an environment credential can skip the login command and avoid persisting the key.

On a runner shared with a human login, use HYPERFRAMES_CONFIG_DIR to point the job to its own private credential directory. Keep it out of build artifacts and caches. Run status in the same job context where the hosted command will run, since a different user, shell, or project directory can resolve a different credential.

Storage and precedence

On CLI 0.10.10 the default credential file is ~/.hyperframes/credentials, with ~ referring to the user running the CLI. HYPERFRAMES_CONFIG_DIR changes the base directory. The store can hold a saved API key and an OAuth session. Use the CLI to inspect or clear the login. The credential file contains secrets and should stay out of repositories and shared logs.

For standard HeyGen requests, the resolver in this release uses these sources in order:

  1. An externally supplied HEYGEN_ACCESS_TOKEN, when present.
  2. A usable saved OAuth login. The CLI can refresh that session when necessary.
  3. A shell HEYGEN_API_KEY or its alias HYPERFRAMES_API_KEY.
  4. A saved API key.
  5. A project's dotenv key when no shell key or stored login or key is present.

That order is why setting HEYGEN_API_KEY alone might leave a desktop job on the previous account. Check status before using hosted services, especially on a shared machine. See the CLI source for the resolver and sign-in implementation.

Status, logout, and common failures

bash
npx hyperframes auth status
npx hyperframes auth logout

An isolated non-interactive session with no credential printed:

text
Not signed in to HeyGen (non-interactive).

A signed-in status can show account details, so review its output before sharing it. auth logout clears the stored credential after confirmation. Use auth logout --keep-api-key if you intend to clear only the OAuth session and retain a previously saved API key. After logout, an environment key can still be active. If status still shows an account, check the reported source and change the credential supplied by that environment.

  • The browser flow is unavailable on SSH. Use --device in a human-operated session. A window on your laptop and an OAuth callback on a remote machine are different endpoints.
  • Device approval is rejected in CI. Use a CI job secret and run status in the job. Keep device approval for a person at a terminal.
  • The wrong account appears. Check the OAuth or API key source in status. An active browser login outranks a shell key. Clear the stored login when changing desktop accounts, or isolate your CI configuration.
  • The login has expired. Sign in again using the method that matches the machine. If the next operation is a local render, you can run it while the hosted login is unresolved.

See HyperFrames pricing for the distinctions among a local export, a HeyGen cloud job, and a Studio plan.

Frequently asked questions

Do I need to run npx hyperframes auth login to render locally?
No. A local composition can be previewed and rendered without signing in. Hosted operations such as cloud render and share require a credential.
Why is auth login --device rejected in CI?
Device flow needs a human to approve it in a browser. The CLI disables it in CI. Supply an API key through your CI secret manager for hosted work.
Does HEYGEN_API_KEY override an active browser login?
For the normal HeyGen service, an active saved OAuth login takes precedence over the shell API key. Use an isolated credential directory for CI.

Related guides