Private preview: this is rolling out and may not be available on your account yet.
1
Start the browser sign-in
deviceLogin needs an unauthenticated client. It calls onUserCode once, with the address and short code to show the person, then waits for them to approve.2
Store the token
deviceLogin returns the token and never stores it. Keep credential.token wherever you keep secrets.3
Authenticate with it
sumvinPat takes the token, or a function that returns it.In production, personal access tokens only work from approved Sumvin clients, identified by their user-agent. A request that carries the token from any other client, or with no user-agent, is refused with 403 and code CLI-403-001.When sign-in fails
Each failure is its own error class, and all of them extendDeviceLoginError.
To stop waiting, pass an
AbortSignal as signal.
Carrying a Stamped Mandate
An agent that holds a Stamped Mandate token sends it withpintToken. It always travels alongside the personal access token, never instead of it: a request with only a mandate token is refused.