30 lines
896 B
Markdown
30 lines
896 B
Markdown
|
|
# Fresh Web Page Actor Demo
|
||
|
|
|
||
|
|
This is a fresh browser sample. It is served by Vite, not by Matrix Web,
|
||
|
|
HiveCast gateway, Host Service, or any Matrix/HiveCast HTTP service.
|
||
|
|
|
||
|
|
It uses:
|
||
|
|
|
||
|
|
- `@open-matrix/sdk` in the browser
|
||
|
|
- Vite only for static page serving and a tiny dev-only credential endpoint
|
||
|
|
- a HiveCast API key on the dev server side
|
||
|
|
- HiveCast `/api/install/actor-credential`
|
||
|
|
- NATS WebSocket for the actual actor bus
|
||
|
|
|
||
|
|
The API key is never bundled into the browser. Vite reads it from environment
|
||
|
|
variables and exchanges it for a short-lived actor credential.
|
||
|
|
|
||
|
|
## Run
|
||
|
|
|
||
|
|
```bash
|
||
|
|
export MATRIX_CLOUD=https://<your-hivecast-cloud>
|
||
|
|
export MATRIX_SPACE=<your-space-root>
|
||
|
|
export MATRIX_API_KEY=<your-hivecast-api-key>
|
||
|
|
|
||
|
|
pnpm install
|
||
|
|
pnpm --filter matrix-sdk-example-fresh-web-page dev
|
||
|
|
```
|
||
|
|
|
||
|
|
Open the printed Vite URL. The page mounts a browser actor and calls it over
|
||
|
|
HiveCast-backed NATS WebSocket.
|