# WaitSpin Quickstart

Use this credential-free path when an agent needs one clean WaitSpin onboarding
run. It uses static CLI fixtures only.

Canonical agent-readable quickstart: https://waitspin.com/quickstart.md

## Credential-Free Demo Path

```bash
npm view waitspin version
export WAITSPIN_API_KEY=wts_demo_agent_quickstart
npx --yes waitspin market --demo --json
npx --yes waitspin bid create --demo --line "Your ad" --url https://example.com --price-per-block 500 --blocks 1 --json
npx --yes waitspin bid checkout demo_campaign_001 --demo --json
npx --yes waitspin status --all --demo --json
```

`waitspin market --demo --json` returns at least this shape:

```json
{
  "ok": true,
  "mode": "demo",
  "campaigns": [
    {
      "campaign_id": "demo_campaign_001"
    }
  ]
}
```

For a machine assertion, check `campaigns[0].campaign_id`:

```bash
npx --yes waitspin market --demo --json \
  | jq -e '.ok == true and .mode == "demo" and .campaigns[0].campaign_id == "demo_campaign_001"'
```

Done means every demo command returns `ok: true`, `"mode": "demo"`, and
stable demo IDs such as `demo_campaign_001` and
`demo_block_purchase_001`. This path does not create an account, campaign,
Stripe Checkout, install, publisher event, payout, or billable impression.

## Non-JS Agents

WaitSpin is CLI-first. No native Python, Go, or language-specific SDK is required.
Non-JS agents should shell out to `npx --yes waitspin ... --json` and parse stdout.

```python
import json
import subprocess

result = subprocess.run(
    ["npx", "--yes", "waitspin", "market", "--demo", "--json"],
    capture_output=True,
    text=True,
    check=True,
)
market = json.loads(result.stdout)
```

```go
package main

import (
	"encoding/json"
	"os/exec"
)

func main() {
	output, err := exec.Command("npx", "--yes", "waitspin", "market", "--demo", "--json").Output()
	if err != nil {
		panic(err)
	}
	var market map[string]any
	if err := json.Unmarshal(output, &market); err != nil {
		panic(err)
	}
}
```

## Authenticated Advertiser/Publisher Path

```bash
npm view waitspin version
npx --yes waitspin init --email you@example.com --key-profile control
# Check the email inbox, then verify the OTP before using the returned key.
npx --yes waitspin init --email you@example.com --code CODE_FROM_EMAIL --key-profile control --json
export WAITSPIN_API_KEY=wts_live_key_returned_by_verified_init
waitspin bid create --line "Your ad" --url https://example.com --price-per-block 500 --blocks 1
waitspin bid checkout CAMPAIGN_ID
# Agent-native stablecoin pay-in: POST /v1/blocks/mpp-crypto and follow the
# 402 Payment challenge until WaitSpin returns Payment-Receipt.
npx --yes waitspin init --email you@example.com --key-profile publisher-extension
# Check the email inbox again if prompted, then verify the publisher key.
npx --yes waitspin init --email you@example.com --code CODE_FROM_EMAIL --key-profile publisher-extension --json
read -rs WAITSPIN_API_KEY && export WAITSPIN_API_KEY && printf '\n'

# Install every detected all-install target.
waitspin install --all --dry-run --compose-existing
waitspin install --all --compose-existing
waitspin status --all
```

WaitSpin is CLI-first. Python, Go, and shell agents should call the CLI and parse
JSON unless a future native SDK is explicitly documented.
