Event Game Play
Generic event prediction component for sports and entertainment events. Supports flexible outcome types — boolean, number, enum, free input — with countdown timers, points display, and detailed result breakdowns.
Import
import { EventGamePlay } from "fansunited-frontend-components";
import { EventGamePlayProps, WidgetTemplate } from "fansunited-frontend-core";Required props
| Prop | Type | Description |
|---|---|---|
entityId | string | Event Game identifier. |
sdk | FansUnitedSDKModel | SDK instance. |
template | WidgetTemplate | STANDARD, SPLIT, or OVERLAY. |
language | LanguageType | Display language. |
Optional props
| Prop | Type | Description |
|---|---|---|
themeOptions | CustomThemeOptions | See Theming. |
leads | LeadsOptions | Lead collection is not supported on this component; this prop is reserved. |
consents | ConsentsConfig | Profile consent checkboxes. See Consents and the section below. |
imagePosition | "left" | "right" | STANDARD template only. |
defaultImagePlaceholderUrl | string | Fallback image URL. |
userIsLoggedIn | boolean | Host auth state. |
signInCTA | SignInCTADetails | See Sign-in CTA. |
additionalCTA | AdditionalCTADetails | See Additional CTA. |
showCountdown | boolean | Show countdown timer while the game is OPEN. |
showPoints | boolean | Show points display per fixture. |
showPredictionDetails | boolean | Show detailed prediction results after settling. |
rulesDisplay | RulesDisplay | See Rules Display. |
callbacks | EventGamePlayCallbacks | onFinish — see Callbacks. |
Outcome types
EventGamePlay supports four flexible outcome types per fixture, configured in the Fans United backend:
| Type | Description | Example |
|---|---|---|
BOOLEAN | Yes/No prediction | "Will the total points exceed 225?" |
NUMBER | Numeric prediction (with optional min/max validation) | "How many total points will be scored?" |
ENUM | Multiple-choice selection from predefined options | "Who will be the game's leading scorer?" |
FREE_INPUT | Open text input | "What will be the exact final score?" |
Status lifecycle
| Status | Behavior |
|---|---|
PENDING | Not yet open for predictions. |
OPEN | Default playable state. |
LIVE | Event has started — no new predictions accepted. |
CLOSED | Backend resolving predictions. |
SETTLED | Predictions resolved; leaderboard available. |
Consents
Collect profile consents alongside the prediction. The shape is the shared ConsentDef — see Consents for the full field reference and the URL tokens.
import { ConsentsConfig } from "fansunited-frontend-core";
const consents: ConsentsConfig = {
items: [
{
consentId: "terms",
body: "I accept the {{privacyPolicyUrl}} and the {{termsAndConditionsUrl}}",
required: true,
},
{ consentId: "marketing", body: "Send me news and offers by email", position: "after" },
],
};
<EventGamePlay {...otherProps} consents={consents} />position | Consent surface |
|---|---|
"before" (default) | A gate screen shown before the prediction UI; the consents are recorded when the user continues |
"after" | Its own step between pressing Play and the prediction being submitted |
Unlike the other game widgets, EventGamePlay renders no lead form, so there is no lead-form absorption here — the consents always use their own surfaces. Without ctaLabel, the gate uses the game's Start label and the step its Play label.
The consent record carries the game's entityId but no entityType, because the Profile API's ConsentEntityType has no event-game member.
Examples
Basic
<EventGamePlay
entityId="event-game-123"
sdk={sdk}
template={WidgetTemplate.STANDARD}
language="en"
/>Fully configured
<EventGamePlay
entityId="event-game-123"
sdk={sdk}
template={WidgetTemplate.OVERLAY}
language="en"
showCountdown
showPoints
showPredictionDetails
themeOptions={{
mode: "dark",
colorSchemes: {
dark: {
textPrimary: "#ffffff",
surface: "#1a1a1a",
},
},
}}
/>Updated about 16 hours ago
