Skip to Content
Advanced: Direct SDKReact IntegrationBlackjack

Blackjack

Classic card game — beat the dealer by getting closer to 21 without going over.

Import

import { BlackjackGameSDK } from '@maktubbet/sdk/blackjack' import '@maktubbet/sdk/blackjack/styles.css'

Usage

'use client' import { useState } from 'react' import { BlackjackGameSDK } from '@maktubbet/sdk/blackjack' import '@maktubbet/sdk/blackjack/styles.css' export default function BlackjackPage() { return ( <BlackjackGameSDK 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>} cardLogo={<img src="/card-logo.svg" alt="Card logo" />} 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 card dealing — realistic card deal and flip animations
  • Hit, Stand, Double, Split — full blackjack action set
  • Dealer AI — dealer follows standard house rules
  • Bet history — track recent results

Props

See Shared PropsBlackjackGameSDK accepts the standard BlackjackGameSDKProps interface.

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

logo renders in the game’s bottom bar and on the back of the cards. Pass cardLogo to use a different logo on the card backs only — it overrides logo there and falls back to logo when omitted.

Last updated on