Skip to content
Back to the app

Push Notifications ​

Besides email and your own webhook endpoints, CHANGENTS.AI can tell a browser you use when:

NotificationSent when
Run finishedA run of yours ended completed, partial or cancelled
Run failedA run of yours ended failed
Approval neededA run of yours stopped at a step that waits for a person

A notification names the agent and what happened, and opens the workspace when you click it. It never carries a run's inputs or results. A run that is waiting for approval is not reported as finished.

Turning it on ​

Open Workspace → Overview, find Push notifications and press Turn on for this browser. The browser asks for permission; once you allow it, this browser is listed under your devices. Do this on each browser you want notified. Send a test sends one to all of them; Remove stops one.

The switches under it choose which of the three you get; Push notifications turns all of them off at once. They apply to every device you registered.

Browser push works in current desktop browsers and Android browsers. On an iPhone or iPad it works only once the workspace has been added to the home screen. The mobile apps do not register for push notifications yet.

If the panel says push notifications are not switched on for this installation, the administrator has not set the keys below.

For administrators ​

Push stays off, and sends nothing, until its keys are set on the backend:

VariableRequired forWhat it is
VAPID_PUBLIC_KEYBrowser pushThe public half of a P-256 key pair, base64url (65 bytes, uncompressed)
VAPID_PRIVATE_KEYBrowser pushThe private half, base64url (32 bytes). Keep it secret
VAPID_SUBJECTBrowser pushA contact for the push services: mailto:ops@yourcompany.com or an https:// URL
EXPO_ACCESS_TOKENMobile pushOptional token for the mobile push service; setting it turns mobile push on
EXPO_PUSH_ENABLEDMobile pushtrue turns mobile push on without a token

Generate a key pair once, for example:

bash
node -e "const c=require('crypto').createECDH('prime256v1');c.generateKeys();console.log('VAPID_PUBLIC_KEY='+c.getPublicKey().toString('base64url'));console.log('VAPID_PRIVATE_KEY='+c.getPrivateKey().toString('base64url'))"

Changing the key pair invalidates every browser registration; people turn push on again.

A device the push service reports as gone (it was unsubscribed or expired) is deleted the next time a notification is sent to it. A person may register up to 20 devices.

Through the API ​

Signed in (session token):

MethodPathWhat it does
GET/api/push/configWhether browser and mobile push are on, and the browser push public key
GET/api/push/subscriptionsYour devices
POST/api/push/subscriptionsRegister {kind: "webpush", subscription} or {kind: "expo", token}
DELETE/api/push/subscriptions/{id}Remove one
GET/api/push/preferencesWhich notifications you get
PUT/api/push/preferencesChange enabled, runFinished, runFailed, approvalRequired
POST/api/push/testSend a test notification to your devices

A browser subscription's endpoint must be https on a public address.

Served from this deployment. No page view leaves it.