From 0e335955c0ed996fca208695088940a530119963 Mon Sep 17 00:00:00 2001 From: Sivert Date: Wed, 7 Oct 2026 13:38:11 +0200 Subject: [PATCH] Document the push:* socket events (GRYT-1690) push:register and push:unregister hand over and take back the capability the relay gave the phone. push:presence says whether the app is in the background. They're on server main since Gryt-chat/server#283, so the reference check can see them now. Co-Authored-By: Claude Opus 5.5 --- content/docs/build/server-api.mdx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/content/docs/build/server-api.mdx b/content/docs/build/server-api.mdx index e56eeae..9f713aa 100644 --- a/content/docs/build/server-api.mdx +++ b/content/docs/build/server-api.mdx @@ -527,6 +527,15 @@ here sit on top of the thread events above. | `presence:heartbeat` | client → server | | `presence:stale` | server → client | +### Push notifications + +The phone gets a capability from the push relay at `push.gryt.chat` and hands it over with `push:register`. It only means something to the relay. The server never sees the Apple or Google token behind it. `push:presence` says whether the app is in the background, and the server only wakes a phone when nobody's at a screen. Both register calls answer through the acknowledgement, with `{ ok: true }` or `{ ok: false, error }`. A server with `GRYT_PUSH_RELAY_URL=off` answers `push_off`. + +| Event | Direction | +|-------|-----------| +| `push:register`, `push:unregister` | client → server | +| `push:presence` | client → server | + ### Moderation | Event | Direction |