Either/Or Play

Binary choice game. Users pick between two options across multiple rounds, with a tutorial screen, timed rounds, score tracking, and an optional standings panel on results.

Import

import { EitherOrPlay } from "fansunited-frontend-components";
import { EitherOrPlayProps, WidgetTemplate } from "fansunited-frontend-core";

Required props

PropTypeDescription
entityIdstringEither/Or game identifier.
sdkFansUnitedSDKModelSDK instance.
templateWidgetTemplateSTANDARD or OVERLAY. (No SPLIT.)
languageLanguageTypeDisplay language.

Optional props

PropTypeDescription
themeOptionsCustomThemeOptionsSee Theming.
leadsLeadsOptionsSee Lead Collection.
consentsConsentsConfigProfile consent checkboxes. See Consents and the section below.
imagePosition"left" | "right"STANDARD template only.
defaultImagePlaceholderUrlstringFallback image URL.
userIsLoggedInbooleanHost auth state.
signInCTASignInCTADetailsSee Sign-in CTA.
additionalCTAAdditionalCTADetailsSee Additional CTA.
rulesDisplayRulesDisplaySee Rules Display.
showStandingsbooleanShow standings/leaderboard panel on the results screen.
callbacksEitherOrPlayCallbacksonFinish — see Callbacks.

Gameplay

  1. Tutorial screen introduces the rules.
  2. Rounds — each round shows two options side by side. The user picks one before the round timer expires.
  3. Results screen displays the score and (optionally) standings vs. other participants.

Standings panel

showStandings={true} adds a leaderboard panel on the results screen showing how the user ranks vs. other participants.

<EitherOrPlay {...otherProps} showStandings />

Consents

Collect profile consents alongside the participation. 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" },
  ],
};

<EitherOrPlay {...otherProps} consents={consents} />
Game configurationConsent surface
authRequirement: "LEAD" + leads.position setThe lead form, at the lead's position — all consents, each position ignored
No lead form"before" → the tutorial screen, whose Start button records them before the game begins; "after" → its own step between the last answer and the results

The "before" consents are recorded before participateInEitherOr starts the game, so the per-pair timer never runs while the checkboxes are on screen. Without ctaLabel, the tutorial keeps the game's Start label and the consent step uses its Finish label.

Examples

Basic

<EitherOrPlay
  entityId="either-or-123"
  sdk={sdk}
  template={WidgetTemplate.STANDARD}
  language="en"
/>

Customized

<EitherOrPlay
  entityId="either-or-123"
  sdk={sdk}
  template={WidgetTemplate.OVERLAY}
  language="en"
  showStandings
  userIsLoggedIn={false}
  signInCTA={{ defaultLabel: "Sign in to play", onClick: openSignIn }}
  leads={{
    position: "after",
    fields: ["fullName", "email"],
    campaignId: "either-or-campaign",
    campaignName: "Fan Preference 2024",
    phoneCountryCode: "44",
    syncWithProfile: true,
  }}
  themeOptions={{ mode: "dark" }}
/>

Did this page help you?