Skip to content

Customization Options

The FanFest embed inherits your channel's theme automatically. This page covers additional customization you can apply from the SDK side.

Background Color

Set the embed iframe's background color to match your page while the embed loads:

js
FanFestSDK.init({
  clientId: 'YOUR_WEB_APP_ID',
  iframe: {
    backgroundColor: '#1a1a2e'
  }
})

This prevents a flash of white (or mismatched color) before the embed content renders.

Host Callbacks

SSO Required

hostLoginFn and hostRewardsFn only work when you have an SSO integration set up. Without SSO, these callbacks are not triggered. If you're using the embed-only tier, skip this section.

The SDK provides two callback hooks that let you integrate the embed with your site's own login and rewards experiences.

hostLoginFn

Called when a user taps "Log in" inside the FanFest embed. Use this to trigger your own authentication flow instead of (or alongside) FanFest's built-in login:

js
FanFestSDK.init({
  clientId: 'YOUR_WEB_APP_ID',
  hostLoginFn: function () {
    // Open your site's login modal
    document.getElementById('login-modal').showModal()
  }
})

hostRewardsFn

Called when a user taps "Rewards" inside the embed. Use this to route users to your own rewards experience:

js
FanFestSDK.init({
  clientId: 'YOUR_WEB_APP_ID',
  hostRewardsFn: function () {
    window.location.href = '/rewards'
  }
})

Channel Theming

The visual appearance of the embed (colors, branding, logo) is controlled by your channel's theme in the FanFest dashboard. Changes to your channel theme are reflected in the embed automatically.

See the Brand Guidelines for details on:

All Init Options

OptionTypeRequiredDefaultDescription
clientIdstringYes--Your FanFest Web App ID
apiBasestringNohttps://api.fanfest.vipAPI base URL (override for staging/dev)
appOriginstringNohttps://fanfest.vipFanFest app origin (override for staging/dev)
iframe.backgroundColorstringNovar(--color-brand-background)Embed iframe background color
hostLoginFn() => voidNoundefinedCallback when user taps Log in
hostRewardsFn() => voidNoundefinedCallback when user taps Rewards

For a deeper dive into all configuration options and advanced patterns, see the Embed Configuration Reference.

Released under the MIT License.