Quickstart
The ten lines that put the feed on a page, and the listener that receives your first event. Copy-paste ready, pointed at staging.
1 · The iframe
<div id="feed" style="width:420px;height:880px"></div>
<script src="https://staging.fidra.tech/fidra-embed.js"></script>
<script>
const feed = Fidra.mount(document.getElementById('feed'), {
theme: 'sapphire', // 'fidra' | 'emerald' | 'sapphire' | 'sunset'
accent: '#3D7BFF', // your brand accent — wins over the base skin
operatorId: 'yourco', // tenant join key, stamped on every event
games: ['crash', 'mines', 'plinko', 'chain'],
onEvent: (e) => console.log('[fidra event]', e),
onMessage: (m) => console.log('[fidra msg]', m),
})
</script>
staging.fidra.tech propagates, the same build answers at https://fidra-staging.vercel.app.That mounts a playable feed with fidra's demo games and the demo wallet (virtual credits). feed.updateTheme(…), feed.updateWallet(balance), feed.pause() and feed.destroy() are available on the handle. Bundler users: @fidra/sdk's createFidraFeed is the same contract, typed.
2 · The listener — your first event
window.addEventListener('message', (e) => {
if (e.data?.source === 'fidra' && e.data.proto === 'fidra:v1') {
console.log(e.data.type, e.data) // fidra:v1:ready, session_start, bet_placed, …
}
})
Every message from the feed carries source: 'fidra' and proto: 'fidra:v1'. The full message families are on the Events page.
3 · Rules you will hit on day one
gamesneeds ≥ 2 entries; 4+ recommended. Fewer than 2 stops the mount:Fidra.mountthrowsconfig_min_games; a raw postMessage init getsfidra:v1:error {code:'config_min_games'}. A one-game "feed" is rejected by design.- No
initwithin 5s → demo config. An embed can never strand the player on a blank screen. - Your real games need a
catalog+ a launch handler. Supplycatalog(your aggregator's game list) and answerfidra:v1:launch_requestwith a tokenized URL — the feed opens your certified game in full mode and never touches its wallet.
4 · The three host handlers (when you go beyond demo)
| feed asks | you reply | required when |
|---|---|---|
fidra:v1:launch_request | launch_url (or launch_error) with a tokenized URL from your launch API, echoing nonce | any catalog game |
fidra:v1:bet_intent / settle_intent | bet_result / settle_result echoing roundId, within 3s | wallet: 'operator' only |
fidra:v1:realtime_update host → feed | — (you push tournament/community data) | optional; without it these run simulated |
A complete reference host — loader + mount + all three handlers backed by three stub server functions — ships in the repo at examples/operator/ (node examples/operator/server.mjs → http://localhost:4700). The public equivalent is the embed demo — view-source friendly.
Next
Work through the integration checklist in order. It is the same list fidra's side works from.
docs/EMBED.md · docs/integration/README.md
fidra is a B2B software supplier — no gambling services operated, no player funds held.
g.jgerenaia@tomsons.co