@open-matrix/sdk (0.1.4)
Installation
@open-matrix:registry=npm install @open-matrix/sdk@0.1.4"@open-matrix/sdk": "0.1.4"About this package
@open-matrix/sdk
Public Matrix actor SDK facade for package authors.
Prefer narrow package imports when a package only needs one layer:
import { MatrixActor } from '@open-matrix/core';
Use this umbrella package when a package intentionally needs the combined actor, browser host, contracts, federation, and Omega kernel facade.
Import browser app build utilities directly from @open-matrix/browser-kit so
headless actor packages can import @open-matrix/sdk without loading
browser-only custom element code.
HiveCast-Managed Transport
For HiveCast-backed actors, use a HiveCast API key to exchange for short-lived actor-scoped NATS credentials:
import { exchangeHiveCastActorCredential } from '@open-matrix/sdk';
const credential = await exchangeHiveCastActorCredential({
cloud: process.env.MATRIX_CLOUD!,
space: process.env.MATRIX_SPACE!,
apiKey: process.env.MATRIX_API_KEY!,
}, {
mount: 'fresh.server.echo',
accepts: { echo: { description: 'Echo a message', message: 'string' } },
});
The exchange returns NATS URLs plus a JWT/seed pair for the requested mount.
Server actors use NatsTransport with credential.transport.natsUrl; browser
actors use createBrowserNatsTransport with
credential.transport.natsWsUrl.
Runnable demos:
demos/fresh-server-actordemos/fresh-web-page
Proof:
MATRIX_CLOUD=https://<your-hivecast-cloud> \
MATRIX_SPACE=<your-space-root> \
MATRIX_API_KEY=<your-hivecast-api-key> \
pnpm run prove:fresh-samples
Dependencies
Dependencies
| ID | Version |
|---|---|
| @open-matrix/browser-host | 0.1.4 |
| @open-matrix/browser-kit | 0.1.4 |
| @open-matrix/contracts | 0.1.4 |
| @open-matrix/core | 0.1.4 |
| @open-matrix/federation | 0.2.4 |
| @open-matrix/omega-core | 0.1.4 |
Development Dependencies
| ID | Version |
|---|---|
| typescript | ^5.7.0 |