Skip to Content
Futures TradingVanilla JS

Vanilla JS Integration

Futures does not have a vanilla JS mount function. @maktubbet/sdk/vanilla (the framework-agnostic mount API used by games like Dice, Mines, and Crash) does not currently include a futures entry point.

If you’re not using React, you have two options:

Embed Futures the same way you’d embed any Maktub game — no JavaScript framework required at all. See Getting Started → and use futures as the game path:

<div data-maktub-game="futures" data-token="TOKEN_FROM_STEP_1" data-bg="#101a18" data-accent="#22c993" ></div> <script src="https://play.maktub.bet/embed.js" async></script>

This is the same embed used by every other game, works without React, and gets you the full trading UI plus automatic resizing.

Option 2: Mount the React Component Yourself

If your app already ships React (even alongside another framework), you can mount FuturesGameSDK directly with react-dom/client:

import { createElement } from 'react' import { createRoot } from 'react-dom/client' import { FuturesGameSDK } from '@maktubbet/sdk/futures' import '@maktubbet/sdk/futures/styles.css' const root = createRoot(document.getElementById('trading')) root.render( createElement(FuturesGameSDK, { accessToken: 'user-jwt-token', user: { betCount: 0, isAuthenticated: true }, updateBalance: (balance) => console.log('Balance:', balance), onAuthRequired: () => console.log('Auth required'), symbol: 'BTC', }) ) // To unmount: // root.unmount()

See Getting Started (React) → for the full prop list and examples.

Next Steps

Last updated on