Runtime Service APIs
Reference entry for runtime `services.*` APIs used by flow nodes, hooks, and plugins.
Binding note. These pages document the stable services.* contract surface
(signatures match the client SDK and packages/spec/src/contracts/). In this
repo's runtime, hook bodies reach scoped data operations through ctx.api,
while plugin code resolves any registered service through ctx.getService(...) —
a literal services.* object is not injected into hook contexts by the open
framework today. Managed runtimes provide the services.* binding directly.
services.* is the accessor spelling, not necessarily the registry slot. The name
after services. is what this chapter documents each surface under; the string you pass
to ctx.getService(...) is the slot the implementation is registered by. They are the
same word for every service below — storage included, since the #9683 rename made
storage the canonical slot (its pre-rename spelling file-storage stays a deprecated
v17 alias — see services.storage).
Each page states its own slot in a Registry slot bullet;
scripts/check-runtime-services-index.mjs holds those to a real registerService call.
This chapter documents the runtime services.* APIs used in hook/action/flow/plugin code:
services.dataservices.sharingservices.auditservices.queueservices.emailservices.smsservices.settingsservices.storage
Stability Legend
| Level | Meaning |
|---|---|
stable | Backward-compatible within a major version |
experimental | API is available but may change in minor releases |
These two labels are the whole vocabulary. The same list is written out again as
Stability Labels, and
scripts/check-runtime-services-index.mjs holds both legends — and every page's
Stability bullet — to one definition, so a page cannot publish a label neither legend
defines. Adding a label means extending that definition in the same change that says what
it promises, in both places.
Source of Truth
Each page links the canonical TypeScript source used to derive signatures.
- Data:
packages/client/src/index.ts - Sharing:
packages/spec/src/contracts/sharing-service.ts - Queue:
packages/spec/src/contracts/queue-service.ts - Email:
packages/spec/src/contracts/email-service.ts - SMS:
packages/spec/src/contracts/sms-service.ts - Storage:
packages/spec/src/contracts/storage-service.ts - Settings:
packages/services/service-settings/src/settings-service.ts - Audit:
packages/plugins/plugin-audit/src/auth-event-audit.ts
services.security is not on this list. The kernel registers a security service,
but it is an internal accessor rather than a documented runtime service, so this chapter
has no page for it. For access decisions read the
permissions guide — the one in-process call most readers need is
shown in Explain Access — and the interface an
implementation must provide, ISecurityService, is listed with the other
kernel contracts.
Not this: the settings audit sink
A second audit shape shares the word and is easy to reach for by mistake.
SettingsAuditSink — canonical source
packages/services/service-settings/src/settings-service.types.ts — is
constructor-injected into service-settings, which calls its record() after a
settings write lands. It is never registered as, or resolved from, the services.audit
slot: that slot's only registrant is @objectstack/plugin-audit, and the object it
returns exposes recordAuthEvent, not record. See
services.audit for the full contrast.