Protocol / Services / Hooks Service
shippedLayer 1 · Protocol

Hooks Service

A subscribe/webhook service that fires on space writes, letting clients and backends react to changes in real time, via tinycloud.hooks/* capabilities.

Hooks Service

The hooks service lets a client or backend react to writes in an space — by subscribing for live updates or registering a webhook — exercised through tinycloud.hooks/* capabilities. It is how an app gets a push instead of polling when space data changes.

Role

A Layer 1 service for eventing. It turns the space's ordered write stream (see epochs-dag) into notifications a capability-holder can consume, without granting it broader access.

Shape

  • resource{spaceId}/hooks[/{path}] (subscribe scoped to a path/prefix).
  • abilitiestinycloud.hooks/{subscribe, …} (+ webhook registration).

Mechanics

Writes pass through tinycloud-core/src/write_hooks.rs, which fires registered hooks; the HTTP surface (subscribe streams / webhook registration) is tinycloud-node-server/src/routes/hooks.rs; the client is HooksService (packages/sdk-services/src/hooks/). A subscription is itself authorized by a capability over {spaceId}/hooks.

Relationships

A service over an space; consumes the same write events ordered by epochs-dag; gated by capabilities; Listen uses tinycloud.hooks/subscribe for live transcript updates.

Status & drift

Shipped.

Sources

  • tinycloud-node: tinycloud-node-server/src/routes/hooks.rs, tinycloud-core/src/write_hooks.rs
  • js-sdk: packages/sdk-services/src/hooks/HooksService.ts