Skip to main content

API Reference

This page summarizes the public surfaces most host apps need. The canonical package APIs live in the main luxy repo and should be checked before release.

Core package

@luxy-creative/core exports shared outcome, theme, haptic, accessibility, animation, reduced-motion, and quality primitives.

APIPurpose
LuxyOutcomeShared outcome contract used by reward components.
OutcomeModeUnion for outcome, resolveOutcome, and odds.
OutcomeResolverAsync resolver contract for backend-first rewards.
WeightedOutcomeLocal weighted demo outcome entry.
resolveLuxyOutcomeResolves the active outcome mode.
pickWeightedOutcomePicks local demo outcomes.
createOutcomeResolutionCacheCaches resolver state by interaction when needed.
LuxyTheme / LuxyThemeOverridesRuntime product theme contracts.
LuxyQualityTierauto, low, medium, or high quality policy.
LuxyReducedMotionPolicyReduced-motion behavior contract.
createHapticSchedulerSchedules host haptic drivers.
createAccessibilityConfigBuilds component accessibility labels and hints.

Scratch package

@luxy-creative/scratch-card exports both the high-level ticket layer and low-level card primitive.

APIPurpose
ScratchTicket / ScratchTicketPropsHigh-level gameplay ticket component and props.
ScratchCard / ScratchCardPropsLow-level reveal component and props.
ScratchCardHandleImperative card handle.
ScratchTicketGameGameplay union: number match, symbol grid, bonus reveal, custom.
ScratchTicketLayoutConfigTicket layout options and labels.
ScratchTicketAssetsExpo Image source slots for ticket art.
ScratchTicketThemeTicket-level color overrides.
ScratchCoverPreset / ScratchCoverMaterialCover material contracts.
ScratchBrushConfigBrush size and sampling configuration.
ScratchZone / ScratchZoneProgressNormalized scratch zones and per-zone progress.
ScratchHapticsConfigScratch haptic milestones.
ScratchParticleConfig / ScratchSparkleConfigPremium effect configuration.
evaluateNumberMatchGameLocal preview evaluator for number-match games.
evaluateSymbolGridGameLocal preview evaluator for symbol-grid games.
evaluateBonusRevealGameLocal preview evaluator for bonus-reveal games.

Slot package

@luxy-creative/slot-machine exports deterministic spin-to-win components and engine helpers.

APIPurpose
SlotMachine / SlotMachinePropsSlot component and props.
SlotMachineHandleImperative slot handle.
SlotOutcome / SlotOutcomePayloadSlot-specific outcome shape, including payload.stops.
SlotSymbolSymbol id, label, value, and metadata contract.
SlotPhysicsReel physics tuning.
SlotEffectsConfigGlass, payline glow, motion blur, and win treatment config.
SlotHapticsConfigSlot haptic scheduling config.
SlotMachineControllerController API for spin state.
SlotSpinSchedulerReel runtime scheduler.
computeTargetCellMaps final stops to reel cells.
computeMotionBlurOpacityDerives blur opacity from velocity and config.

Callback policy

Callbacks are analytics and UI hooks, not secret transport. Pass reward ids, interaction ids, and state transitions. Do not pass raw tokens, full customer records, or fraud details.