realtime

Broadcast loyalty events to WebSocket clients via PartyKit rooms.

Updated May 7, 2026
One-click install
npx skills add https://github.com/johinsDev/loyalty-app --skill realtime-johinsdev
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: realtime
Source: https://github.com/johinsDev/loyalty-app/tree/main/.claude/skills/realtime
Command: npx skills add https://github.com/johinsDev/loyalty-app --skill realtime-johinsdev

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Realtime connection gaps and delayed UI updates prevent loyalty events from feeling instantaneous for customers and staff.

Core Features & Use Cases

  • Real-time WebSocket updates via PartyKit: publish low-latency events such as stamp earned, reward ready, and promo announcements to connected clients.
  • Ticket-based authentication + HMAC-protected publishing: keep PartyKit rooms secure across origins by using short-lived HS256 tickets for clients and a shared-secret HMAC signature for server-to-party broadcasts.
  • Customer and org room patterns: support per-customer live updates (customer rooms) and future/planned dashboard live feeds (org rooms), with test coverage using a fake realtime client.

Quick Start

Publish a customer live update by calling your server-side realtime publisher to send event stamp.earned with small data payload to the room customer:<id>.

Frequently Asked Questions about realtime

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I stream live loyalty events to PWA clients with WebSocket?

Stream live loyalty events to PWA clients by publishing low-latency WebSocket updates via PartyKit room broadcasts. This enables sub-100ms delivery of stamp earned animations and reward readiness updates to connected clients.

How does ticket-based authentication work for WebSocket connections?

Ticket-based authentication issues short-lived HS256 tickets for client connections to verify identity. This secures PartyKit rooms across origins by ensuring only authorized clients can receive real-time loyalty event broadcasts.

Do I need HMAC signatures to publish server-to-party WebSocket broadcasts?

Yes, you need X-Realtime-Signature HMAC verification for server-to-party publish requests. This shared-secret signature secures broadcasts into customer and org rooms, preventing unauthorized event injection.

Can I broadcast live updates to per-customer and org rooms separately?

Yes, the realtime WebSocket delivery supports per-customer live updates via customer rooms and dashboard live feeds via org rooms. Publish events like stamp.earned to customer:<id> rooms for targeted broadcasts.

What's the best way to trigger live UI animations for loyalty rewards in-app?

Trigger live UI animations by publishing loyalty events such as stamp.earned and reward ready through the realtime publisher to connected PWA clients. PartyKit room broadcasts deliver these updates with sub-100ms latency for instant visual feedback.

Does PartyKit work with tRPC for real-time WebSocket updates?

PartyKit broadcasts real-time WebSocket events to connected PWA and admin clients, supporting live UI updates. It uses ticket-based authentication and HMAC verification to secure server-to-party publish requests across origins.