Skip to Content

Defuse (Vanilla JS)

Defuse the bomb before it explodes — watch fuses light up every 2 seconds and cash out before a red one appears.

Quick Start

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Defuse Game</title> <link rel="stylesheet" href="https://unpkg.com/@maktubbet/sdk/dist/defuse/styles.css" /> <script src="https://unpkg.com/@maktubbet/sdk/dist/vanilla.global.js"></script> </head> <body> <div id="defuse-game"></div> <script> const game = MaktubSDK.defuse('#defuse-game', { accessToken: null, user: { betCount: 0, isAuthenticated: false }, updateBalance: function (newBalance) { console.log('Balance:', newBalance) }, onAuthRequired: function () { console.log('Auth required') }, currency: { code: 'USD', prefix: '$', rate: 1 }, language: 'en', }) // Update props later // game.update({ accessToken: 'user-jwt-token' }) // Clean up when done // game.destroy() </script> </body> </html>

With ESM Bundler

import MaktubSDK from '@maktubbet/sdk/vanilla' import '@maktubbet/sdk/defuse/styles.css' const game = MaktubSDK.defuse('#defuse-game', { accessToken: null, user: { betCount: 0, isAuthenticated: false }, updateBalance: (b) => { console.log('Balance:', b) }, onAuthRequired: () => console.log('Auth required'), currency: { code: 'USD', prefix: '$', rate: 1 }, language: 'en', })

Dynamic Updates

// Authenticate the user game.update({ accessToken: 'new-jwt-token', user: { betCount: 10, isAuthenticated: true }, }) // Change currency game.update({ currency: { code: 'EUR', prefix: '€', rate: 0.92 }, })

Cleanup

game.destroy()
Last updated on