Configuration

Both lightbox() and inline() accept a configuration object. The only required property is id.

Properties

PropertyTypeDefaultDescription
idstringRequired. The content module ID. This ID is supplied during the production process and can be found on the content module page in this portal.
variantstringnullPositional variant code selecting which version of each chapter to show. See Variants.
contentRecord<string, string>{}Personalisation data for the content module. Keys match the replacement patterns shown on the content module page (e.g. vA, vC).
dataOriginstringCDNURL of the vc folder for self-hosted content. See Self-hosting.
dataPathstring"data.json"Override the data file path relative to the data origin.
mode"watch" | "read""watch""watch" plays the standard video experience. "read" provides an accessible text-based view. Can be changed at runtime with setMode().
brandingobject{}Customise colors, typography, fonts, and logo. See Branding.
wrapperElementstring"body"CSS selector for the container element. Inline player only.
targetElementstringCSS selector for the element(s) that trigger the lightbox (e.g. #play-button or .play-buttons). If not set, use show() and hide() to control manually. Lightbox player only.
showExitPlayerButtonbooleantrueWhether to show the exit button. Lightbox player only.
nextStepsobjectContent displayed at the end of the journey: heading, body text, and action buttons. See Next Steps below.
unrecoverableErrorCustomHtmlstringCustom HTML to display when an unrecoverable error occurs. Supports buttons, links, and formatted text.

Player methods

Both player types return an instance with these methods:

MethodDescription
on(event, callback)Listen for player events. See Events.
destroy()Remove the player from the DOM and clean up all resources.
setMode(mode)Switch between "watch" and "read" mode at runtime.

The lightbox player also has:

MethodDescription
show()Open the lightbox overlay.
hide()Close the lightbox overlay.

Next Steps

The nextSteps property defines content displayed at the end of the viewer's journey. It includes a heading, optional body text, and action buttons.

lightbox({
  id: 'YOUR_MODULE_ID',
  nextSteps: {
    header: {
      headingText: 'What happens next?',
      bodyText: 'Choose one of the options below.',
    },
    steps: [],
  },
})

Full example

import { lightbox } from '@fcxtech/player'

const player = lightbox({
  id: 'YOUR_MODULE_ID',
  variant: 'bbabba',
  content: {
    vA: '03/15/2026',
    vC: '$3,500.00',
  },
  branding: {
    colors: {
      brandColor1: 'rgb(186 48 0)',
      brandColor1Text: 'rgb(255 255 255)',
    },
    logo: {
      imageUrl: 'https://example.com/logo.png',
      imageWidth: '200px',
    },
  },
  targetElement: '#play-button',
})

player.on('complete', (event) => {
  console.log('Video completed', event)
})