ObjectStackObjectStack

Push Config schema — System Protocol reference

Push Service Configuration Protocol — how the push channel reaches the vendors.

Push Service Configuration Protocol — how the push channel reaches the vendors.

Read by @objectstack/service-push. PushServicePlugin parses its config option with PushServiceConfigSchema when it initialises: for the relay transport it sends through the hosted push relay with the server's cloud binding credential, and for the direct transport it builds one vendor transport per block. The push channel in @objectstack/service-messaging delivers through the push service it registers. Under objectstack serve the value is the stack definition's push key, read when the stack declares requires: ['push'] (below).

Two transports, and the hosted relay is the default. The store-published ObjectOS app is signed with ObjectStack's own APNs key and Firebase project, and those credentials never leave ObjectStack. So a server delivers to that app through the hosted push relay (transport: 'relay'), which holds the credentials and forwards each delivery to APNs or FCM. The relay authenticates the server by its cloud binding credential (cloud ADR-0008, the oscc_… bearer the server received when it was bound), so the relay block carries no credential of its own. It sees only an opaque, ID-only payload: the wire shape is PushRelayRequestSchema (api/push-relay.zod.ts).

The direct transport (transport: 'direct') is for a white-label build: an app signed with the operator's own APNs key and Firebase project, which the relay cannot deliver to. It carries one block per vendor (ADR-0012 §4: Apple Push Notification service with token-based auth, and Firebase Cloud Messaging over its HTTP v1 API), each naming its secret by reference.

What a block without transport reads as. transport is the discriminator, and a block may leave it out: with no vendor block it reads as the relay, the default; with an apns or fcm block it reads as direct, which is the shape this schema had before the relay existed. A block that names transport is judged by that transport alone. Two mixed shapes are refused when they are written: a relay block that carries a credential (a vendor block, or a key an operator would reach for), and a direct block with no vendor block, which names no credentialRef and so could deliver to nothing.

What is served. Both transports, in @objectstack/service-push (ADR-0012, amended 2026-11-03, #29041), read by objectstack serve from the stack's push key. The relay sender (#29920) reads the binding credential from the cloud-binding service on every send, so a server that is not bound yet still boots: its push channel reports no transport until the bind is done, and the bind takes effect without a restart. The boot refuses a relay block, the default {} included, only on a deployment that declared it has no control plane (OS_CLOUD_URL=off), where nothing could ever deliver through the relay (ADR-0012 §6.1, the air-gap rule).

It sits beside EmailServiceConfigSchema (email-config.zod.ts), the declaration of the email channel's transport selection.

Secrets are references, never values (ADR-0143 D3, ADR-0097 §3). Each direct vendor block has one secret — the APNs .p8 signing key and the FCM service-account JSON — and each is named by a credentialRef, the same key every other secret an author names is written under (ADR-0143 D3), which the push transport resolves through the secrets layer when it first signs (in the open tier, the name of an environment variable). An inline secret is refused two ways: written under a key an operator would reach for (key, privateKey, serviceAccount, …), it is refused by name with credentialRef as the prescription; written into the reference itself, it is refused because a reference is one token — a PEM block carries whitespace and a JSON document carries braces, and a name carries neither.

What reads it: the stack's push key under objectstack serve. It is the stack definition's top-level push key, beside email and sms. A stack that declares requires: ['push'] has objectstack serve (and @objectstack/verify's bootStack) mount PushServicePlugin, built by resolvePushCapabilityArg (@objectstack/service-push) from that key. The reader parses the key with this schema again at boot, because a compiled artifact may not have passed defineStack, and it refuses two things there, failing the boot: a relay block (the default {} and an absent key included) on a deployment that declared it has no control plane, and an inline secret. A host that composes the plugin in code hands it the value through the constructor instead. No OS_PUSH_* environment variable carries any of it: the vendor blocks hold no secret to override, and each credentialRef already names one.

Out of scope here: the domestic Android vendors (HMS / Honor / Xiaomi / OPPO / vivo). ADR-0012 §6.1 has the hosted relay front them in phase 2, as further values of vendor, the token type the sender routes on; there is no per-vendor plugin and no per-vendor channel.

Source: packages/spec/src/system/push-config.zod.ts

TypeScript Usage

import { ApnsTransportConfigSchema, FcmTransportConfigSchema, PushDirectTransportConfigSchema, PushRelayTransportConfigSchema, PushServiceConfigSchema, PushVendorSchema } from '@objectstack/spec/system';
import type { ApnsTransportConfig, FcmTransportConfig, PushDirectTransportConfig, PushRelayTransportConfig, PushServiceConfig, PushVendor } from '@objectstack/spec/system';

// Validate data
const result = ApnsTransportConfigSchema.parse(data);

ApnsTransportConfig

APNs transport with token-based auth (.p8 signing key by reference)

Properties

PropertyTypeRequiredDescription
teamIdstring✅Apple Developer Team ID (10 characters) that issued the signing key
keyIdstring✅Key ID of the APNs auth key (10 characters)
topicstring✅APNs topic: the app bundle ID the pushes are for
environmentEnum<'sandbox' | 'production'>✅APNs gateway: sandbox (development builds) or production (TestFlight and App Store builds)
credentialRefstring✅Secrets-layer reference to the .p8 signing key (an environment-variable name in the open tier). Never the key itself

FcmTransportConfig

FCM HTTP v1 transport (service-account JSON by reference)

Properties

PropertyTypeRequiredDescription
projectIdstring✅Firebase project ID the HTTP v1 send endpoint is addressed to
credentialRefstring✅Secrets-layer reference to the service-account JSON (an environment-variable name in the open tier). Never the JSON itself

PushDirectTransportConfig

Direct push transport for a white-label build: one block per vendor (apns, fcm), at least one, each naming its credential by reference; read by the push service

Properties

PropertyTypeRequiredDescription
transport'direct'optional (default: "direct")Direct delivery with your own APNs key and Firebase project, for a white-label build. A block with a vendor block and no transport reads as direct
apns{ teamId: string; keyId: string; topic: string; environment: Enum<'sandbox' | 'production'>; … }optionalAPNs transport (token-based auth). Absent: no delivery to apns devices
fcm{ projectId: string; credentialRef: string }optionalFCM HTTP v1 transport. Absent: no delivery to fcm devices

Nested Shape: PushDirectTransportConfig.apns

PropertyTypeRequiredDescription
teamIdstring✅Apple Developer Team ID (10 characters) that issued the signing key
keyIdstring✅Key ID of the APNs auth key (10 characters)
topicstring✅APNs topic: the app bundle ID the pushes are for
environmentEnum<'sandbox' | 'production'>✅APNs gateway: sandbox (development builds) or production (TestFlight and App Store builds)
credentialRefstring✅Secrets-layer reference to the .p8 signing key (an environment-variable name in the open tier). Never the key itself

Nested Shape: PushDirectTransportConfig.fcm

PropertyTypeRequiredDescription
projectIdstring✅Firebase project ID the HTTP v1 send endpoint is addressed to
credentialRefstring✅Secrets-layer reference to the service-account JSON (an environment-variable name in the open tier). Never the JSON itself

PushRelayTransportConfig

The hosted push relay transport (the default): authenticated by the server cloud binding credential, so it carries none. Read by the push service, which sends each push to the relay once the server is bound to the cloud

Properties

PropertyTypeRequiredDescription
transport'relay'optional (default: "relay")The hosted push relay. The default: a block with no vendor block reads as relay
endpointstringoptionalThe push relay URL, for a staging relay only. Absent: the production relay. https only, because every request carries the server binding credential

PushServiceConfig

Push channel transport configuration: the hosted relay (the default) or direct delivery to apns and fcm for a white-label build. The push service reads it: relay sends through the hosted relay with the server cloud binding, and direct drives the vendor transports

Union Options

This schema accepts one of the following structures:

Option 1

The hosted push relay transport (the default): authenticated by the server cloud binding credential, so it carries none. Read by the push service, which sends each push to the relay once the server is bound to the cloud

Properties

PropertyTypeRequiredDescription
transport'relay'optional (default: "relay")The hosted push relay. The default: a block with no vendor block reads as relay
endpointstringoptionalThe push relay URL, for a staging relay only. Absent: the production relay. https only, because every request carries the server binding credential

Option 2

Direct push transport for a white-label build: one block per vendor (apns, fcm), at least one, each naming its credential by reference; read by the push service

Properties

PropertyTypeRequiredDescription
transport'direct'optional (default: "direct")Direct delivery with your own APNs key and Firebase project, for a white-label build. A block with a vendor block and no transport reads as direct
apns{ teamId: string; keyId: string; topic: string; environment: Enum<'sandbox' | 'production'>; … }optionalAPNs transport (token-based auth). Absent: no delivery to apns devices
fcm{ projectId: string; credentialRef: string }optionalFCM HTTP v1 transport. Absent: no delivery to fcm devices

Nested Shape: PushServiceConfig[transport='direct'].apns

PropertyTypeRequiredDescription
teamIdstring✅Apple Developer Team ID (10 characters) that issued the signing key
keyIdstring✅Key ID of the APNs auth key (10 characters)
topicstring✅APNs topic: the app bundle ID the pushes are for
environmentEnum<'sandbox' | 'production'>✅APNs gateway: sandbox (development builds) or production (TestFlight and App Store builds)
credentialRefstring✅Secrets-layer reference to the .p8 signing key (an environment-variable name in the open tier). Never the key itself

Nested Shape: PushServiceConfig[transport='direct'].fcm

PropertyTypeRequiredDescription
projectIdstring✅Firebase project ID the HTTP v1 send endpoint is addressed to
credentialRefstring✅Secrets-layer reference to the service-account JSON (an environment-variable name in the open tier). Never the JSON itself


PushVendor

Push vendor core delivers through: apns (Apple Push Notification service) or fcm (Firebase Cloud Messaging HTTP v1)

Allowed Values

  • apns
  • fcm

On this page