Skip to content
1 viewer
View

Notification reference

2 pages, 19 routes, 19 connections and 2 CLI commands, generated from the declarations of Notification without reading storage or running anything.

AboutCode

Code · 0 files

No ingested source sits in a crate named for this app. Either its crate has not been ingested, or the app's name does not match its crate.

Pages · 2

Declared views
PageView idRoleRouteOrderParentEntityNavigation
Listnotification.indexlist/view/notification/list0Notificationin navigation
Listnotification.index/view/notification/inboxin navigation
2 rows

Connections · 19

Notification.Create

Create a new notification (inbox + optional push). Persists a row in `notification_runtime` and broadcasts on `notification.created`.

Notification.Create input
FieldTypeRequiredDescriptionAllowed
titlerequired
1 row
Calls and output

Notification.Demo.Email

Zero-input demo: fires a canned channel=email notification to the local peer rendered through the canonical email template. Uses `CRE8_DEMO_EMAIL` env var as the recipient address (default `demo@cre8.local`). Delivery requires PROVIDER_SENDGRID_API_KEY + PROVIDER_SENDGRID_FROM_EMAIL; without them the send fails visibly, because messaging's provider auto-select refuses to fall back to the mock. Pass payload.provider='mock' to absorb it offline.

Calls and output
  • Output keynotification.result
  • Classificationreal
  • POST /notification/demo/emailHTTP route

Notification.Demo.Push

Zero-input demo: fires a canned channel=push notification to the local peer through the full builder + delivery loop. No subscription enrolled → returns `unreachable` with a diagnostic so the demo confirms the wire path. Subscription enrolled → fans out via the webpush provider stub which logs the would-be send.

Calls and output
  • Output keynotification.result
  • Classificationreal
  • POST /notification/demo/pushHTTP route

Notification.Demo.Sms

Zero-input demo: fires a canned channel=sms notification to the local peer rendered through the canonical SMS template (≤2 segments). Uses `CRE8_DEMO_SMS_TO` env var as the recipient phone (E.164 format like +15551234567); default is the RFC-5612 reserved test line +15555550100 so unconfigured demos fail visibly at Twilio's API rather than text a stranger. Real delivery requires PROVIDER_TWILIO_ACCOUNT_SID + PROVIDER_TWILIO_AUTH_TOKEN + PROVIDER_TWILIO_FROM_NUMBER.

Calls and output
  • Output keynotification.result
  • Classificationreal
  • POST /notification/demo/smsHTTP route

Notification.Demo.Voice

Zero-input demo: fires a canned channel=voice notification that issues an outbound Twilio call. The Twilio API is invoked with a `Url` pointing at this runtime's /messaging/twiml/{call_id} endpoint; when the call connects, Twilio fetches that URL and we reply with a TwiML <Say>+ <Hangup> driving the playback. Recipient = CRE8_DEMO_VOICE_TO env var (E.164, default +15555550100 — RFC-5612 reserved test line). Requires PROVIDER_TWILIO_ACCOUNT_SID + PROVIDER_TWILIO_AUTH_TOKEN + PROVIDER_TWILIO_FROM_NUMBER + CRE8_MESSAGING_BASE_URL set to a publicly reachable URL (e.g. an ngrok tunnel or production hostname); otherwise Twilio's Calls.create fails visibly. Set CRE8_MESSAGING_DETECT_VOICEMAIL=true to opt into machine detection and voicemail-leave branching.

Calls and output
  • Output keynotification.result
  • Classificationreal
  • POST /notification/demo/voiceHTTP route

Notification.Dismiss

Dismiss a notification — mutates row status to `dismissed`. Removes from inbox surfacing.

Notification.Dismiss input
FieldTypeRequiredDescriptionAllowed
idrequired
1 row
Calls and output
  • Output keynotification.result
  • Classificationreal
  • POST /notification/dismissHTTP route

Notification.DrainDue

Deliver the scheduled sends that have come due (held at create because `deliver_after` was in the future) through the same messaging path an immediate notification takes. Each item is claimed once, then marked `sent` or `failed` with its delivery report. No HTTP route: the gateway runs it when CRE8_NOTIFICATION_DRAIN_INTERVAL_S > 0.

Notification.DrainDue input
FieldTypeRequiredDescriptionAllowed
limitoptional
1 row
Calls and output
  • Output keynotification.result
  • Classificationreal

Notification.Due

List notifications whose `deliver_after` has passed but are still pending.

Calls and output
  • Output keynotification.result
  • Classificationroute_handler
  • GET /notification/dueHTTP route

Notification.Get

Fetch a single notification by id.

Notification.Get input
FieldTypeRequiredDescriptionAllowed
idrequired
1 row
Calls and output
  • Output keynotification.result
  • Classificationroute_handler
  • GET /notification/detailHTTP route

Notification.Inbox

List inbox notifications for the local peer (with optional limit).

Calls and output
  • Output keynotification.result
  • Classificationroute_handler
  • GET /notificationHTTP route
  • GET /notification/inboxHTTP route
  • notification inboxCLI command

Notification.PushSubscribe

Enroll a push subscription for the local peer. Three kinds supported via the `kind` field: `web` (browser web-push, requires endpoint + p256dh + auth), `fcm` (Android / Chrome, requires device_token from FCM SDK), `apns` (iOS, requires hex device_token from Apple). Default kind=web for back-compat with N.4 enrollments. Idempotent by endpoint (mobile kinds synthesize an `fcm://<token>` or `apns://<token>` endpoint); re-enrolling the same device updates the row in place. The matching messaging provider (webpush / fcm / apns) sends to each row on channel=push delivery.

Notification.PushSubscribe input
FieldTypeRequiredDescriptionAllowed
kindoptional
endpointoptional
p256dhoptional
authoptional
device_tokenoptional
user_agentoptional
target_peer_idoptional
7 rows
Calls and output
  • Output keynotification.result
  • Classificationreal
  • POST /notification/push-subscribeHTTP route

Notification.PushUnsubscribe

Remove a browser web-push subscription by endpoint. Used when the browser's PushSubscription is revoked or when the user opts out.

Notification.PushUnsubscribe input
FieldTypeRequiredDescriptionAllowed
endpointrequired
1 row
Calls and output
  • Output keynotification.result
  • Classificationreal
  • POST /notification/push-unsubscribeHTTP route

Notification.Read

Mark a notification (or list of ids) as read. Mutates the row's status from `pending` → `read`.

Notification.Read input
FieldTypeRequiredDescriptionAllowed
idrequired
1 row
Calls and output
  • Output keynotification.result
  • Classificationreal
  • POST /notification/readHTTP route

Notification.Status

Notification subsystem health / counts (pending / read / dismissed).

Calls and output
  • Output keynotification.result
  • Classificationroute_handler
  • GET /notification/statusHTTP route

Notification.Subscribe

Subscribe the local peer to a topic. When any app publishes a notification with this topic (via NotificationBuilder::publish), the subscriber gets fanned out one notification per channel listed on the subscription. Optional `source_app` / `source_id` filters narrow to specific publishers or specific source items. `priority_floor` filters to only notifications at or above the given priority. Channels defaults to ["inbox"]; pass ["inbox","push","email"] to fan out across multiple transports. Idempotent by (peer, topic, source_app, source_id) — re-subscribing the same triple updates channels / floor in place.

Notification.Subscribe input
FieldTypeRequiredDescriptionAllowed
topicrequired
channelsoptional
source_appoptional
source_idoptional
priority_flooroptional
target_peer_idoptional
6 rows
Calls and output
  • Output keynotification.result
  • Classificationreal
  • POST /notification/subscribeHTTP route

Notification.Subscriptions

List the local peer's topic subscriptions.

Notification.Subscriptions input
FieldTypeRequiredDescriptionAllowed
target_peer_idoptional
1 row
Calls and output
  • Output keynotification.result
  • Classificationroute_handler
  • GET /notification/subscriptionsHTTP route

Notification.Unsubscribe

Remove a topic subscription — either by `id` (precise) or by `(peer, topic)` (drops every subscription a peer has on that topic regardless of source filters).

Notification.Unsubscribe input
FieldTypeRequiredDescriptionAllowed
subscription_idoptional
topicoptional
target_peer_idoptional
3 rows
Calls and output
  • Output keynotification.result
  • Classificationreal
  • POST /notification/unsubscribeHTTP route

Notification.VapidPublicKey

Return the runtime's VAPID public key (base64url-no-pad uncompressed SEC1 P-256 point). Auto-generated + persisted at notification.boot if not configured via env vars. Browsers pass this to `pushManager.subscribe({ applicationServerKey })`.

Calls and output
  • Output keynotification.result
  • Classificationroute_handler
  • GET /notification/vapid-public-keyHTTP route

Notification.Withdraw

Withdraw notifications before they are delivered or seen, by `id`/`ids` or by `source_app` + `source_id` (+ `topic`). Only pending rows move: `queued`, a held outbound send not yet claimed by a drain pass, or an unread inbox notice; the write is a compare-and-set on the observed status, so a withdrawal and a drain claim never both win. Allowed for the target account, or for the source app's in-process service origin (scope `notification-withdraw`).

Notification.Withdraw input
FieldTypeRequiredDescriptionAllowed
idoptional
idsoptional
source_appoptional
source_idoptional
topicoptional
reasonoptional
6 rows
Calls and output
  • Output keynotification.result
  • Classificationreal
  • POST /notification/withdrawHTTP route

CLI commands · 2

notification create

Create a local inbox notification

notification create {"title":"Check ballot","body":"Daily position is ready"}

notification inbox

List local runtime notifications

notification inbox

Schema and data model

Declared storage and kinds. Linked kinds open their app pages.

Declared storage
Hyper vertex kinds read
  • None declared.
Hyper vertex kinds written
  • None declared.
Hyper edge kinds written
  • None declared.
Asset namespaces read
  • None declared.
Asset namespaces minted
  • None declared.
Model warnings
  • No model warnings were reported.

Capabilities and dependencies

Depends on
  • Truth
  • Messaging

Structure review · 2

Warnings · 2