Skip to main content

runtime

@webda/runtime

Webda runtime service bundle — router, cluster coordination, proxy, invitation system, version endpoint, migration store, and core utility models bundled for use in any Webda deployment.

When to use it​

  • You need a cluster-coordination service (ClusterService) to synchronize multiple Webda instances via pub/sub.
  • You want a built-in VersionService endpoint (GET /version) that returns the current application version.
  • You need an HTTP reverse proxy (ProxyService) to forward matching requests to an upstream service.
  • You need an invitation/join-code workflow (InvitationService) for user onboarding.

Install​

pnpm add @webda/runtime

What's inside​

Services​

  • ClusterService — Coordinates multiple Webda instances via a pub/sub channel; broadcasts invalidation events (source)
  • EchoService — Development helper that echoes request bodies back to the caller (source)
  • InvitationService — Token-based invitation/join-code system for model membership (source)
  • ProxyService — HTTP reverse proxy that forwards requests matching a URL prefix to an upstream host (source)
  • VersionService — Exposes a /version endpoint returning the application name and version (source)

Stores​

  • MigrationStore — Wraps another store and runs model migrations on read (source)

Utility models​

  • BinaryModel — Base model with binary attachment support (source)
  • PasswordModel — Secure password hashing helper (source)

Quick config example​

{
"services": {
"versionService": {
"type": "VersionService",
"url": "/version"
},
"proxy": {
"type": "ProxyService",
"url": "/legacy",
"upstream": "http://old-service:8080"
}
}
}

Reference​

Classes​

Interfaces​

Functions​