drift Docs
Start
What is Drift?
The tour, if you are new here.
Why Drift?
The case for a smaller cloud.
Getting started
Nothing to deployed, in one command.
Architecture
How a slice is put together.
What it costs
The free grant, five unit prices, two rules.
Build
Canvas
Static sites, same origin as your API.
Tools
Operate
Auth
Accounts, tokens and scopes.
Security
Boundaries, sandboxing and hardening.

drift account

Your identity against the platform, a different thing from the auth your own app uses. Authentication keeps the three apart.

Command Description
drift account createSign up. Prompts for username, email, and password, then verifies by email. --invite-code is required while signup is invite-only.
drift account loginLog in and store a session
drift account reset-passwordEmails you a reset code, then walks you through setting a new password
drift account delete [--yes]Delete your account and everything tied to it: every slice, every record, all object storage. Irreversible; asks twice, and the second prompt makes you type your username.

Signing up

Signup is two steps. create posts your details, the platform emails an 8-digit code, and you type it back to finish. Under invite-only mode the invite code takes the place of that email check, so the CLI skips the prompt and says so.

Shell
$ drift account create --invite-code DRIFT-XXXX
Username: alice
Email: alice@example.com
Password: ********

Sending verification code...
Invite-only alpha: skipping email verification (your invite code is the gate).

An invite is minted for one email address, so a code that reached you by another route won't sign you up as someone else. For CI, pass --username, --email, and --password-stdin. Once you're logged in the CLI keeps your session and refreshes it for you; you won't be asked again on this machine.

--password leaks into ps and your shell history.

It exists and warns when you use it: the value lands in ps output and your shell history. --password-stdin is the one to reach for in CI.

The session on disk

Your login and active slice live in ~/.drift/session.json (mode 0600, inside a 0700 directory), bound to a per-machine device_id beside it. The active slice is preserved across logins. Every authenticated request carries:

  • Authorization: Bearer <jwt>, your identity
  • X-Slice: <active-slice>, the target slice

Tokens refresh automatically on a 401; if the refresh fails you're prompted to log in again. Authentication has the token pair's lifetimes and what happens when a spent refresh token is replayed.