| | | | |
source | The source identifier for the session | number | - | - |
language | The language code for the session | array | Supported Languages | - |
siteId | The site identifier | number | - | - |
socketUrl | WebSocket URL for the connection | string | - | - |
onSessionError | onSessionError is a required callback for initSwarmSession / useInitSDK. The SDK calls it whenever the session cannot be created or the transport carrying it fails — a duplicate initialization, an unresolvable afec token, or a WebSocket error. | function | - | - |
onSessionSuccess | onSessionSuccess is a required callback passed to initSwarmSession / useInitSDK. The SDK calls it when Swarm answers the request_session command — the moment the session becomes usable.
It receives the raw session payload, whose main use is ip / host; the reCAPTCHA and Turnstile fields in it are stored and acted on by the SDK itself. | function | - | - |
afec | User Hash | string | - | - |
xPoint | Enables XPoint fraud-prevention validation for protected commands e.g. login, register). Runs before the request is sent to the server. Has no effect when isNativeApp is true. | object | | - |
└─ clientKey | Client Key | string | - | - |
└─ enableXPoint | Flag to enable Xpoint | boolean | true / false | - |
└─ onResolve | Callback argument 'data' is '' when the user is allowed, or the X_POINT sentinel when blocked. Use this callback to apply the result to the pending request in your UI. | function | - | - |
releaseDate | Consumer application release date | string | - | - |
onReconnectError | onReconnectError is an optional callback you pass to initSwarmSession / useInitSDK. It calls, when the SDK's automatic reconnection fails. | function | - | - |
onReconnectSuccess | onReconnectSuccess is optional method and called after the WebSocket successfully reconnects and a new session is established. | function | - | - |
reCaptchaPlatform | To handle reCAPTCHA in a native application, we need to inform the backend which platform the session is being opened for. This parameter helps us handle this scenario. You can specify the platform (Android or iOS) for which the session is being opened. If this parameter is not provided, the session opening process will proceed in the standard mode. | string | "ios" / "android" | - |
isCashDesk | Opens a cash desk session for betshop cashier clients (cash desk / POS apps). Set it to true only in those apps, never in a player-facing site or app. The SDK then sends is_cashdesk: true in the request_session command; when the flag is omitted or false nothing is sent and the session behaves as before.
Why it exists: Swarm blocks an IP address that sends many requests failing reCAPTCHA, and every request_session from a blocked IP is then refused with code 21 (Operation not allowed). Betshop tills share one public IP, so one block would stop the whole shop from selling or paying out. With isCashDesk: true the session is created even if the IP is currently blocked.
The trade-off: the session is restricted for its whole lifetime, and Swarm refuses player-account commands in it with code 42 (msg 'Not allowed in cashdesk session', data is the refused command name). The SDK reports this as the not_allowed_in_cashdesk_session error. Refused groups:
- Login: login, restore_login, social network login, RFID / NemID / iDIN / MetaMask login, getSocialNetworkFrontUrl and the like.
- Registration: registerUser, registerUserBySocialInfo, user verification.
- Password: forgot / reset / change / create password and wrong-login-attempt resets.
- 2FA and verification codes: two-factor setup and codes, phone and email verification, SMS codes.
- Money and account: deposit, withdraw, transfers, wallets, bank accounts, updateUser, self-exclusion and deposit / login limits.
Still allowed: cashier commands (betshop_*, terminal_*, cash_desk_deposit, cashdesk_other_expense, cashdesk_other_income, create_bet_from_betshop, get_bet_shops, get_cashdesk_report), data subscriptions (get / unsubscribe) and logout. Sportsbook data and bet placement through betshop_* work as usual. | boolean | true / false | - |