Appearance
Getting Started
The Innovede SDK provides a unified interface for frontend applications to interact with our Casino Platform backend. It handles API key injection, session management, and token refreshes automatically.
Installation
Install the SDK via NPM or Yarn:
bash
npm install @innovassion/innovede-sdk
# or
yarn add @innovassion/innovede-sdkPackage page: npmjs.com/package/@innovassion/innovede-sdk
Initialization
Import the SDK into your application's root file and initialize it with your Platform API Key and target environment.
javascript
import { PlatformSDK } from '@innovassion/innovede-sdk';
const sdk = new PlatformSDK({
apiKey: 'your-platform-api-key', // Provided by your operator backoffice
environment: 'production', // 'sandbox' | 'staging' | 'production'
baseUrl: 'https://api.mycasino.com' // Optional: override the default API endpoint
});Environments
production: Connects to the live casino backend.staging: Connects to the staging environment for QA testing.sandbox: Connects to built-in realistic sample data; build and test every module immediately. See Environments & Sandbox Data.
Custom API Endpoint
By default, the SDK connects to the Innovede platform endpoints. If you are self-hosting the backend (or using a white-label domain), pass baseUrl to point the SDK at your own API. The WebSocket endpoint for real-time messaging is derived automatically from this URL.
Framework Integration
Because the SDK handles its own state, you should initialize it once and make it available to your components.
React Example (Context API):
javascript
import { createContext, useContext } from 'react';
import { PlatformSDK } from '@innovassion/innovede-sdk';
const sdk = new PlatformSDK({ apiKey: 'xxx', environment: 'staging' });
const SdkContext = createContext(sdk);
export const useSdk = () => useContext(SdkContext);Important: session restore is asynchronous. A returning user's session is silently restored on startup; await the readiness signal before rendering protected routes:
javascript
const authenticated = await sdk.auth.sessionReady;
// true = session restored; safe to render the app now