API Documentation

Developer Documentation

Everything you need to integrate our games into your platform. Our RESTful API follows OpenAPI 3.0 specification with comprehensive examples in multiple languages.

Authentication

API Key Authentication

All API requests must include your API key in the Authorization header. You will receive separate keys for sandbox and production environments upon registration.

Request Headers
Authorization: Bearer sf_live_your_api_key_here
Content-Type: application/json
X-Request-ID: unique-request-id-for-idempotency

Security Note: Never expose your API keys in client-side code. All API calls must be made from your backend server. Rotate your keys immediately if you suspect they have been compromised.

Quick Start

1

Install the SDK

Terminal
# Node.js
$ npm install @slotforge/sdk

# Python
$ pip install slotforge-sdk

# PHP
$ composer require slotforge/sdk
2

Initialize the Client

server.ts
import { SlotForge } from '@slotforge/sdk';

const client = new SlotForge({
  apiKey: process.env.SLOTFORGE_API_KEY,
  environment: 'sandbox',
  walletUrl: 'https://your-api.com/wallet'
});
3

Launch a Game Session

launch-game.ts
// Launch a game session for a player
const session = await client.games.launch({
  gameId: 'pharaohs-fortune-megaways',
  playerId: 'player_12345',
  currency: 'EUR',
  language: 'en',
  returnUrl: 'https://casino.com/lobby'
});

// Embed in iframe
console.log(session.gameUrl);
// => https://games.slotforge.io/play/abc123...
4

Implement Wallet Callback

wallet-handler.ts
// Your wallet endpoint receives bet/win callbacks
app.post('/wallet/callback', async (req, res) => {
  const { action, playerId, amount, roundId } = req.body;

  if (action === 'bet') {
    const balance = await debitPlayer(playerId, amount);
    return res.json({ balance });
  }

  if (action === 'win') {
    const balance = await creditPlayer(playerId, amount);
    return res.json({ balance });
  }
});