Web push notifications
Re-engage players with self-hosted Web Push (VAPID): subscribe from the game, send from the dashboard/MCP to everyone, a segment, or one player.
Push notifications bring players back: a reward is ready, it's their turn, a live event started. Triggair uses standards-based Web Push (VAPID): no third-party vendor, no per-message cost, and the same delivery whether the browser's push service is Chrome's, Firefox's, or Safari's.
Subscribing (in the game)
Web Push needs a service worker in your app (it's what shows the notification). Register it, then call tg.push.subscribe(): the SDK fetches the game's VAPID key, asks the browser to subscribe, and registers it server-side. Subscribing is refused for minors and age-unknown players by the behavioral_push compliance gate (the same gate that guards other regulated features), so screen age first with tg.compliance.setAge.
await navigator.serviceWorker.register('/sw.js');
try {
await tg.push.subscribe();
} catch (e) {
// age_restricted / parental_consent_required for minors — offer the age screen
} The service worker
Your service worker receives the push and shows it. The payload is JSON: { title, body?, url?, icon? }.
self.addEventListener('push', (e) => {
const n = e.data.json();
e.waitUntil(self.registration.showNotification(n.title, { body: n.body, icon: n.icon, data: n }));
});
self.addEventListener('notificationclick', (e) => {
e.notification.close();
if (e.notification.data?.url) e.waitUntil(clients.openWindow(e.notification.data.url));
}); Sending (dashboard / MCP)
Send from the dashboard Push panel or the triggair_send_push MCP tool: a title + optional body/url, targeted at everyone, a materialized segment (reuse your LiveOps segments), or a single player. Delivery returns { sent, failed, removed }: dead subscriptions are pruned automatically, so your list stays clean. Sending is a server/operator action; the game never sends push to itself.
- User-generated content
Author, publish, play, and remix player content, with moderation and remix lineage.
- LiveOps: config, flags, segments and codes
Change the live game with no client deploy: remote config, feature flags, player segments, live events, and promo codes.
- A/B experiments
Split players across variants, measure a metric, and read per-variant conversion: deterministic, sticky assignment built on the flags/segments engine.
- Verifiable RNG
Deterministic, server-seeded randomness so loot and crit rolls can't be client-forged.
- Analytics and crash reporting
Durable event ingest that rolls up into DAU/MAU, retention, funnels, sessions, economy health, and grouped crashes.