Skip to Content
Advanced: Direct SDKReact IntegrationCoin Flip

Coin Flip

Pick heads or tails and flip the coin — classic 50/50 odds with animated coin flip.

Import

import { CoinFlipGameSDK } from '@maktubbet/sdk/coinflip' import '@maktubbet/sdk/coinflip/styles.css'

Usage

'use client' import { useState } from 'react' import { CoinFlipGameSDK } from '@maktubbet/sdk/coinflip' import '@maktubbet/sdk/coinflip/styles.css' export default function CoinFlipPage() { return ( <CoinFlipGameSDK accessToken="user-jwt-token" user={{ betCount: 0, isAuthenticated: true }} updateBalance={(newBalance) => console.log(newBalance)} onAuthRequired={() => console.log('Auth required')} currency={{ code: 'USD', prefix: '$', rate: 1 }} language="en" logo={<span>MY LOGO</span>} onToast={(t) => console.log('Toast:', t.title)} theme={{ backgroundDark: '#0D1117', backgroundDarkLight: '#161B22', inputBackground: '#0D1117', actionButtonColor: '#1C2333', buttonColor: '#FFFFFF', }} /> ) }

Demo Mode

Demo mode is automatically enabled when a user places a bet with a $0 amount. To run the game entirely client-side without a backend session, pass isDemo — see Demo Mode.

Features

  • Animated coin flip — realistic 3D coin flip animation
  • Heads or tails — simple pick-and-flip gameplay
  • Bet history — track recent results

Props

See Shared PropsCoinFlipGameSDK accepts the standard CoinFlipGameSDKProps interface.

PropTypeRequiredDefault
accessTokenstring | null
userGameUser
updateBalance(balance: number) => void
onAuthRequired() => void
currencyGameCurrency{ code: 'USD', prefix: '$', rate: 1 }
languagestring'en'
logoReactNode
onToast(toast: ToastData) => void
themeGameTheme
Last updated on