Quickstart
Sign up, scaffold an app, log in, create it, deploy it, run a workflow and see it in the console. Ten minutes.
This page takes a new account to a workflow run you can see on
<app>.durablesdk.com. It teaches npx durable-sdk init, durable-sdk login, durable-sdk apps create, durable-sdk deploy --prod and
durable-sdk logs.
You need Node 20 or newer and a package manager. Nothing else: the platform runs the database and the cron.
1. Sign up#
Open durablesdk.com/sign-up and join
with an email and a code. Your first organization is made for you (you
are its admin) on the Free tier in the us-east region; rename it on the
dashboard. An agent working from a key skips the browser: see
log in with a key.
2. Scaffold the app#
npx durable-sdk init my-app
cd my-appinit judges the name under the hostname grammar (3 to 40 characters,
a-z, 0-9 and -, a letter first, no reserved word; see
Hosting), writes the template, installs
the dependencies and prints the next commands (the file list is cut
here; the CLI prints all thirty):
durable-sdk init: wrote 30 files under my-app (template 0.1.0)
package.json
vercel.json
tsconfig.json
durable.config.ts
durable.guards.ts
platform.ts
src/durable.ts
src/events/catalog.ts
src/workflows/hello.ts
…
next:
cd my-app
durable-sdk login
durable-sdk apps create my-app
durable-sdk deploy --prodThe tree is the one every hosted app runs: durable.config.ts,
src/workflows/hello.ts (a ten-line keyed workflow), src/events/catalog.ts
(its one fact, hello.said), src/listeners.ts, the engine's handlers
under api/, api/hello.ts (an example door that executes the
workflow), tests/hello.test.ts and an AGENTS.md that tells an agent
everything. Writing a workflow reads
hello.ts line by line.
Run the tests before anything is deployed: hello.test.ts's three
cases (one run per intent, a failing step waits for a redrive, a crash
resumes on attempt 2) and the template's five guard files, whose lines
follow this one:
pnpm test ✓ tests/hello.test.ts (3 tests)3. Log in#
durable-sdk loginopen https://durablesdk.com/cli/authorize?code=WXYZ-2345 and confirm the code WXYZ-2345
durable-sdk login: acme as durable-sdk on moe-laptop, scope deploy, expires 2027-01-27T12:04:31.000Z; stored for https://durablesdk.comThe browser opens when one is there. The page shows the client, the
hostname, the organization and the scope before you press Approve. The
CLI stores the key it receives under ~/.config/durable-sdk/credentials.json
(mode 0600) and never prints it. durable-sdk whoami says who you are;
durable-sdk logout forgets the key. Accounts and keys
has the scopes and the device flow in full.
Log in with a key#
An agent or a CI holds a key a person minted on the dashboard
(/dashboard/keys). Give it on stdin, never as an argument:
printf '%s' "$DURABLE_API_KEY" | durable-sdk login --with-keyOr set DURABLE_API_KEY in the environment and skip login: the
variable wins over the file.
4. Create the app#
durable-sdk apps create my-appCreating my-app in us-east…
database ready
project ready
first build ready
hostname https://my-app.durablesdk.com
my-app is active.apps create reserves the slug (global: one my-app across every
account), makes the app's database with its preview branch, the
project, the platform's variables and the hostname, and deploys the
template once. It writes .durable-sdk/app.json ({ "app": "my-app", "plane": "https://durablesdk.com" }, commit it) so every later verb
knows the app. A taken slug is refused plane.app.slug_taken; pick
another. Hosting says what each line made.
5. Deploy your tree#
durable-sdk deploy --proddurable-sdk deploy: my-app production: 30 files, 1240 KB packed, sha256 7f3c2a1e9b4d
durable-sdk deploy: 7f3c2a1e queued
durable-sdk deploy: 7f3c2a1e building
durable-sdk deploy: 7f3c2a1e checking
durable-sdk deploy: 7f3c2a1e promoted at https://my-app.durablesdk.comThe build runs the migrations against the app's database before it
compiles; a production build is aliased, checked and promoted (the
default rule auto). Exit 0 means promoted. Deploy
has the states, previews, --json and CI.
6. See it answer#
curl https://my-app.durablesdk.com/health{
"ok": true,
"commit": "7f3c2a1e",
"environment": "production",
"role": "production"
}Run the hello workflow through the example door the template ships:
curl -X POST https://my-app.durablesdk.com/api/hello \
-H "Content-Type: application/json" \
-d '{"name":"world"}'{ "runId": "01J…", "status": "COMPLETED" }The door mints a requestId, executes hello.say { name, requestId }
and answers the run. Send the same body twice: two runs, because the
request id differs. Send the same requestId twice (the door accepts one
in the body) and the second answer is the first run's.
7. Read the run#
Open https://durablesdk.com/dashboard/apps/my-app and the Console
tab: the run, its one step with its before and after image, the fact
hello.said and the listener's run beside it. The same read on the
command line:
durable-sdk logs12:04:31 info run hello.say 01J… COMPLETED in 18 ms
12:04:31 info fact hello.said delivered to listener hello.recordLogs says what the stream carries and Console what the tab shows.
What next#
- Change
src/workflows/hello.ts, runpnpm test,durable-sdk deploy --prodagain. Changing a workflow says what a change over runs in flight needs. durable-sdk doctor --hostbefore each deploy: the rules a Durable tree keeps, one line per finding. The doctor.- Give the app a secret:
printf '%s' "$VALUE" | durable-sdk secrets set STRIPE_KEY. Secrets. - Read the database from your laptop:
durable-sdk db read-string. Database. - Every page here is Markdown at
/docs/<slug>.md; an agent starts at/llms.txt.