Notifications

Email (SES)

Transactional email is sent via AWS SES for:

Users can disable most email categories in settings.all.notifications; push notifications for challenges and tournaments follow the same preference flags where applicable (challenge/game push still sends regardless of email toggles for challenges).

Language follows the recipient's language field (locales/*/apback.json). At send time, if the user's language is not yet registered in i18next, notifications fall back to English while the stored preference is kept unchanged — adding a locale later will apply automatically for users who already selected that language.

Web push

VAPID keys (VAPID_PUBLIC_KEY, VAPID_PRIVATE_KEY) enable browser push. Each device/browser subscription is stored as its own PUSH record (sk: <userid>#<subscriptionKey>). Auth queries:

When a push fails with HTTP 404 or 410 (stale endpoint), only that subscription record is deleted.

Your turn batching

The yourturn Lambda runs on a schedule (14:00 and 22:00 UTC, prod only) via EventBridge. It scans active games and sends batched "your turn" emails — not on every move.

Implementation: utils/yourturn.ts.

Push topics

Push messages use topics such as challenges and game-related channels. See sendPush() usage in api/abstractplay.ts.

Related