Skip to content

push

Push notifications (Web Push): the app reaches a person on their devices when something waits on them, the app closed or out of sight.

On this page 7
TypeScript
import { push } from "pairz/plugins/interfaces";

What it keeps

It keeps 2 collections, 1 of them on the record.

CollectionKept asFields
pushLookingin memory, gone on restartperson, visible, at
pushSubscriptiondocumentsperson, device, at; private: endpoint, keys

Its named queries read for callers, as the rules let them:

QueryWho outside runs it
pushSubscription.minepeople, agents for a person, keys and routines

What it lets callers do

Of its 5 Actions, people may call 4; agents may call 1; contacts and someone signed out may call none.

ActionPersonAgentContactAnyoneKeyRoutineWhat it does
push.keyyesyesnonoyesyesThe app's public key for push notifications, or null when they're off.
push.lookingyesnononononoSays whether a tab of yours shows the app now.
push.sendnonononononoSends a notification to a person's devices.
push.subscribeyesnononononoTurns notifications on for this device.
push.unsubscribeyesnononononoTurns notifications off for one of your devices: this one, or one in your list.

An agent works for a person, and calls what both may. A key calls only what its scope names. A routine is work done for a person, which they set going.

It also adds rules every read and write keeps to (guard).

Where it shows

It has no Views of its own: its front ends show it, push-web.

What it needs

Nothing to set. It reads push, resource kinds the app and other plugins fill.

What it requires

It builds on no other plugin.

It ships with pairz@1.0.0-rc.82.

What it does on its own

Some of its work starts without a caller: an event, or the time.

  • push.asked runs on approval.created.
  • push.message runs on message.created.

Listing

It keeps every listing rule.