@tellandshow/engagement-events
v0.0.2
Published
Variant fan-out helpers for the Tell and Show engagement layer. Studios call recordWizardComplete / recordProjectShipped / recordStyleConfirmed / etc to fire bare event + variant + correct XP_AMOUNTS in one call. Closes the variant convention's largest er
Maintainers
Readme
@tellandshow/engagement-events
Variant fan-out helpers for the engagement layer. Studios call one helper per kid action; the helper fires the bare event + variant + correct XP_AMOUNTS in one call.
Why
The engagement layer's event-name convention is "fire bare event AND event:variant":
profile.addEvent({ type: 'style-confirmed', xp: 5 });
profile.addEvent({ type: 'style-confirmed:pixel-art', xp: 0 });Forgetting the variant breaks every per-style/per-track/per-persona badge + wisdom matcher. These helpers make forgetting impossible.
API
import {
recordWizardComplete,
recordStyleConfirmed,
recordQuizCompleted,
recordTweakApplied,
recordProjectShipped,
recordPersonaSwitched,
recordAITransparency,
recordFeedbackSent,
recordFirstTimeBonus,
recordParentApproved,
recordStyleShared,
recordPioneerWelcome,
} from '@tellandshow/engagement-events';
// Each returns the post-event ProfileSnapshot for immediate UI feedback.
recordWizardComplete(profile, { wizardId: 'add-hero', level: 2 });
recordStyleConfirmed(profile, 'pixel-art');
recordProjectShipped(profile, 'game');
recordAITransparency(profile, 'thumbs-up');recordFirstTimeBonus and recordPioneerWelcome are idempotent — second call returns null.
License
MIT.
