https://<brand-name>.widgets.unibo.io/on-site/widget.js<!-- 1. Set player cookies --><script>document.cookie = "unibo_userId=player_123; path=/";document.cookie = "unibo_registrationDate=2023-07-30T00:00:00+00:00; path=/";document.cookie = "unibo_language=en; path=/";</script><!-- 2. Add a custom styled button to open the widget --><button id="unibo-osw-custom-1">Tournaments</button><!-- 3. Load the widget --><script src="https://<brand-name>.widgets.unibo.io/on-site/widget.js"></script>
unibo_userIdplayer_123unibo_registrationDate2023-07-30T00:00:00+00:00unibo_registrationDate2023-07-30T00:00:00+00:0016906752001690675200000unibo_languageendeunibo_currencyEURunibo_currency is only required for platforms with a multi-currency setup where a player can have more than one account currencyid following this pattern:id="unibo-osw-custom-{number}"
<button id="unibo-osw-custom-1" class="your-button-class">Tournaments</button>
<!-- Header --><button id="unibo-osw-custom-1" class="header-btn">Tournaments</button><!-- Sidebar --><a href="#" id="unibo-osw-custom-2" class="sidebar-link">View Promotions</a><!-- Footer --><button id="unibo-osw-custom-3" class="footer-btn">Campaigns</button>
<!-- Button --><button id="unibo-osw-custom-1">Open</button><!-- Div --><div id="unibo-osw-custom-3" role="button">Click here</div>
Existing click handlers are preserved. If your button already has anonclick, it will still fire alongside the widget open action.
<!DOCTYPE html><html><head><title>Example Casino</title></head><body><nav><button id="unibo-osw-custom-1" class="nav-btn">Tournaments</button></nav><script>document.cookie = "unibo_userId=player_123; path=/; Secure; SameSite=Lax";document.cookie = "unibo_registrationDate=1690675200; path=/; Secure; SameSite=Lax";document.cookie = "unibo_language=en; path=/; Secure; SameSite=Lax";</script><script src="https://<brand-name>.widgets.unibo.io/on-site/widget.js"></script></body></html>
// UniboWidget.jsximport { useEffect, useRef } from 'react';const WIDGET_SCRIPT_URL = 'https://<brand-name>.widgets.unibo.io/on-site/widget.js';function setUniboCookies({ userId, registrationDate, language = 'en', currency = 'EUR' }) {const opts = 'path=/; Secure; SameSite=Lax';document.cookie = `unibo_userId=${userId}; ${opts}`;document.cookie = `unibo_registrationDate=${registrationDate}; ${opts}`;document.cookie = `unibo_language=${language}; ${opts}`;}export function UniboWidget({ userId, registrationDate, language, currency }) {const scriptLoaded = useRef(false);useEffect(() => {if (!userId || !registrationDate || scriptLoaded.current) return;setUniboCookies({ userId, registrationDate, language, currency });if (document.querySelector(`script[src="${WIDGET_SCRIPT_URL}"]`)) {scriptLoaded.current = true;return;}const script = document.createElement('script');script.src = WIDGET_SCRIPT_URL;script.async = true;document.body.appendChild(script);scriptLoaded.current = true;}, [userId, registrationDate, language, currency]);return null;}// Nav.jsxexport function Nav() {return (<nav><buttonid="unibo-osw-custom-1"className="nav-btn"type="button">Tournaments</button></nav>);}