smrt
Open the smrt source on GitHub Switch to dark color scheme
← All packages
Content & media v0.62.10 New

@happyvertical/smrt-reactions

Tenant-scoped reactions and lightweight polls on any record, with participation limits enforced by a shared service.

Source ↗

What it gives you

Tenant-scoped reactions and lightweight polls on any record, with participation limits enforced by a shared service.

  1. 01Reaction, Poll, and PollVote models with a ParticipationRuntime on the server entry
  2. 02A profile votes once per poll, and a vote keeps its evidence unchanged
  3. 03ReactionBar and PollCard render authorized projections and call callbacks
  4. 04SQLite and PostgreSQL only; DuckDB is refused

The host binds the actor

ParticipationRuntime.create opens the database and returns the reaction and poll services. The host authenticates the actor and supplies an authorizeRecord callback. A missing callback, a rejection, or an error fails closed.

Participation limits are shared

ParticipationService from smrt-comments owns entitlement, bans, and quotas. A new reaction or vote reserves quota in the same transaction as the write. A failure rolls both back.

Polls are fixed at creation

A poll has two to fifty unique option ids that never change. An identical vote retry succeeds, and a different choice fails. A poll can close and reopen. The package is not a ballot, an election, or a legal audit system.

Components perform no fetch

The Svelte components receive tally props and async callbacks. They make no request and no authorization decision. Refresh the props after each mutation.