Push Notifications
Besides email and your own webhook endpoints, CHANGENTS.AI can tell a browser you use when:
| Notification | Sent when |
|---|---|
| Run finished | A run of yours ended completed, partial or cancelled |
| Run failed | A run of yours ended failed |
| Approval needed | A 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:
| Variable | Required for | What it is |
|---|---|---|
VAPID_PUBLIC_KEY | Browser push | The public half of a P-256 key pair, base64url (65 bytes, uncompressed) |
VAPID_PRIVATE_KEY | Browser push | The private half, base64url (32 bytes). Keep it secret |
VAPID_SUBJECT | Browser push | A contact for the push services: mailto:ops@yourcompany.com or an https:// URL |
EXPO_ACCESS_TOKEN | Mobile push | Optional token for the mobile push service; setting it turns mobile push on |
EXPO_PUSH_ENABLED | Mobile push | true turns mobile push on without a token |
Generate a key pair once, for example:
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):
| Method | Path | What it does |
|---|---|---|
| GET | /api/push/config | Whether browser and mobile push are on, and the browser push public key |
| GET | /api/push/subscriptions | Your devices |
| POST | /api/push/subscriptions | Register {kind: "webpush", subscription} or {kind: "expo", token} |
| DELETE | /api/push/subscriptions/{id} | Remove one |
| GET | /api/push/preferences | Which notifications you get |
| PUT | /api/push/preferences | Change enabled, runFinished, runFailed, approvalRequired |
| POST | /api/push/test | Send a test notification to your devices |
A browser subscription's endpoint must be https on a public address.