Skip to Content

Slide (Vanilla JS)

A multiplayer crash-style game — set your target multiplier, place your bet, and watch the slider climb.

Quick Start

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Slide Game</title> <link rel="stylesheet" href="https://unpkg.com/@maktubbet/sdk/dist/slide/styles.css" /> <script src="https://unpkg.com/@maktubbet/sdk/dist/vanilla.global.js"></script> </head> <body> <div id="slide-game"></div> <script> const game = MaktubSDK.slide('#slide-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', userName: 'Player123', }) </script> </body> </html>

With ESM Bundler

import MaktubSDK from '@maktubbet/sdk/vanilla' import '@maktubbet/sdk/slide/styles.css' const game = MaktubSDK.slide('#slide-game', { accessToken: null, user: { betCount: 0, isAuthenticated: false }, updateBalance: (b) => { console.log('Balance:', b) }, onAuthRequired: () => console.log('Auth required'), userName: 'Player123', })

Dynamic Updates

game.update({ accessToken: 'new-jwt-token', user: { betCount: 10, isAuthenticated: true }, })

Cleanup

game.destroy()
Last updated on