Jump to section

@livstick/widget-react

Widget Documentation

Embed the Livstick video recording widget in your application. Two integration modes: React component or HTML script tag. Full CSS customization, feature flags, i18n, and event hooks.

Installation

Install the widget package from npm.

Install via npmbash
npm install @livstick/widget-react
Also available via:pnpm add @livstick/widget-reactyarn add @livstick/widget-react

Peer dependencies: react >= 18 and react-dom >= 18. React 19 is fully supported.

Integration Modes

Choose between React component import or HTML script tag.

HTML Script Taghtml
<div id="livstick-plugin"></div>

<script
  id="livstick-widget"
  data-uid="zqumhejbvg"
  data-lang="fr_FR"
  data-api-key="wk_xxxx"
  src="https://widget.livstick.com/assets/widget.latest.js"
></script>

Data Attributes

AttributeTypeDescription
data-uidstringUnique identifier for the code/message
data-langstringLanguage code (e.g. fr_FR, en_US)
data-api-keystringWidget API key for authentication
data-autogenerate-uridbooleanAuto-generate URID if not provided
data-sender-emailstringPre-fill the sender email field
data-edit-keystringEdit key to authorize upload
data-debugbooleanEnable debug mode (detailed errors)

Fullpage Mode

For a fullscreen integration where the widget occupies the entire viewport:

Fullpage Layouthtml
<!doctype html>
<html>
  <head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <style>
      html, body { margin: 0; padding: 0; height: 100%; width: 100%; }
      #livstick-plugin { height: 100%; width: 100%; }
    </style>
  </head>
  <body>
    <div id="livstick-plugin"></div>
    <script id="livstick-widget" data-autogenerate-urid="true"></script>
    <script type="module" src="/assets/widget.latest.js"></script>
  </body>
</html>

Customization

Customize every aspect of the widget using CSS custom properties. All variables can be overridden via the styleOverrides prop (React) or directly in your CSS.

CSS VariableTailwind TokenDescription
--fontFamilyTitlefont-titleTitle font family
--fontFamilyTextfont-textBody text font family
--H1FontSizetext-titleH1 title font size
--H2FontSizetext-subtitleH2 title font size
--H3FontSizetext-smalltitleH3 title font size
--PFontSizetext-textParagraph font size
--inputFontSizetext-inputInput text font size
--buttonFontSizetext-buttonButton text font size
--H1LetterSpacingtracking-titleH1 letter spacing
--H2LetterSpacingtracking-subtitleH2 letter spacing
--H3LetterSpacingtracking-smalltitleH3 letter spacing
--PLetterSpacingtracking-textParagraph letter spacing
--buttonLetterSpacingtracking-buttonButton letter spacing
--H1FontWeightfont-titleH1 font weight
--H2FontWeightfont-subtitleH2 font weight
--H3FontWeightfont-smalltitleH3 font weight
--PFontWeightfont-textParagraph font weight
--buttonFontWeightfont-buttonButton font weight
--H2TextTransformCSS text-transform for H2
--H3TextTransformCSS text-transform for H3
--buttonTextTransformCSS text-transform for buttons

Style Overrides React only

In React mode, use the styleOverrides prop to override CSS custom properties without external stylesheets. Keys correspond to variable names without the -- prefix.

styleOverrides exampletsx
<LivstickWidget
  uid="abc123"
  apiKey="wk_xxxx"
  styleOverrides={{
    // Typography
    fontFamilyTitle: '"Playfair Display", serif',
    H1FontSize: '2rem',
    H1ColorDark: '#1a1a2e',

    // Buttons
    buttonPrimaryBackgroundColor: '#e94560',
    buttonPrimaryBackgroundColorHover: '#c73e54',
    buttonPrimaryColor: '#ffffff',
    buttonRadius: '24px',

    // Inputs
    inputBorderColor: '#ddd',
    inputRadius: '8px',

    // Layout
    widgetPadding: '16px',
  }}
/>

Priority Order

Browser defaultsAPI injection (`:root`)styleOverrides

Translations (i18n)

63 translation keys organized by screen. Keys marked HTML support HTML content via dangerouslySetInnerHTML.

Intro3 keys
KeyHTMLDescription
widget_txt_intro_titleYesIntroduction screen title
widget_txt_intro_descriptionYesIntroduction screen description
widget_txt_cancelCancel button text
Global2 keys
KeyHTMLDescription
global_txt_step"Step" label
global_txt_titleGlobal title
Recorder18 keys
KeyHTMLDescription
player_txt_button_startStart recording button
player_txt_button_stopStop recording button
player_txt_button_retryRetry button
player_txt_button_sendSend button
player_txt_button_importImport button
player_txt_mobile_video_buttonMobile video button
player_txt_mobile_titleMobile title
player_infoYesRecording info
player_info2YesSecondary recording info
player_txt_warning_toobig_titleFile too large warning title
player_txt_warning_toobigFile too large warning message
player_txt_titleRecorder title
camera_permission_titleCamera permission title
camera_permission_explanationCamera permission explanation
camera_permission_button_allowAllow camera button
camera_permission_button_importImport button (permission)
camera_permission_or"or" text between options
mobile_txt_import_libraryImport from library text
Form28 keys
KeyHTMLDescription
form_txt_title_formForm title
form_txt_from"From" label
form_txt_from_reinsuranceSender reassurance text
form_txt_from_fnameFirst name label
form_txt_from_lnameLast name label
form_txt_from_emailSender email label
form_txt_from_dobDate of birth label
form_txt_dayDay label
form_txt_monthMonth label
form_txt_yearYear label
form_txt_to"To" label
form_txt_to_reinsuranceRecipient reassurance text
form_txt_to_emailRecipient email label
form_txt_to_bymail"By email" option label
form_txt_to_byphone"By phone" option label
form_txt_countryCountry label
form_txt_add_message_titleMessage area title
form_txt_msg_reinsuranceMessage reassurance text
form_txt_add_message_placeholderMessage placeholder
form_txt_sendSend button text
form_txt_mandatory"Required fields" text
form_txt_checkbox1YesCheckbox text (T&C / consent)
form_txt_schedule_titleScheduling title
form_txt_schedule_title_infoScheduling info
form_txt_schedule_option_now"Now" option
form_txt_schedule_option_later"Later" option
form_txt_schedule_dateSchedule date label
form_txt_preview_unavailablePreview unavailable text
Success4 keys
KeyHTMLDescription
success_txt_success_titleSuccess screen title
success_txt_successYesSuccess message
success_discover_your_messageYes"Discover your message" text
success_discover_your_message_buttonDiscover button text
Loading1 keys
KeyHTMLDescription
loading_txt_sendingSending progress text

JavaScript Events

Listen for widget lifecycle events and programmatically control navigation.

livstickRecordedCustom Event

Fired when the user completes a video recording and upload. Listen on document.

document.addEventListener('livstickRecorded', () => {
  console.log('Video recorded successfully!');
  showSuccessMessage();
});
livstickRouteChangerCustom Event

Fired on internal route changes. The detail property contains the new route name.

document.addEventListener('livstickRouteChanger', (e) => {
  console.log('Widget navigated to:', e.detail);
});
window.livcr(route)Global Function

Programmatically navigate the widget to a specific route.

// Navigate to the recording screen
window.livcr('record');

// Available routes: 'intro' | 'record' | 'loading' | 'finish'
Contact us

Ready to transform your customer experiences?

Let's discuss your project and discover how LIVSTICK can help you create unforgettable moments.

Response within 24h
Personalized demonstration
No commitment
Hello LIVSTICK, I am from .
I am interested in .
You can reach me at