# HiveCast API-Key Login Demo

This demo proves the SDK-side HiveCast credential shape without committing a
secret.

It validates a user-supplied HiveCast API key against the configured HiveCast
cloud, then writes the same package-local `.matrix` config/credential files that
`matrix configure` writes. This is the current API-key login shape.

It does **not** prove hosted broker execution yet. The SDK still needs a
provider-owned credential exchange/login command before a package can use a
HiveCast-issued broker JWT directly from this repo.

## Run

```bash
export MATRIX_CLOUD=https://dev.hivecast.ai
export MATRIX_SPACE=<your-space-root>
export MATRIX_API_KEY=<your-api-key>

pnpm demo:hivecast-login
```

Optional:

```bash
MATRIX_DEMO_HOME=/tmp/my-sdk-hivecast-demo pnpm demo:hivecast-login
MATRIX_DEMO_KEEP=1 pnpm demo:hivecast-login
```

The key is never printed. By default the temporary demo home is deleted after a
successful run. Set `MATRIX_DEMO_KEEP=1` to inspect the generated `.matrix`
files locally.

## Check Script Wiring Without A Key

```bash
pnpm demo:hivecast-login -- --check
```

This only verifies that the demo is installed and intentionally refuses to run
without credentials.
