Skip to main content

Initialize the SDK

Initialize Gameball once, usually at app startup in your main() function:
🔒
Secure API Access: To benefit from v4.1 secure API endpoints, pass the sessionToken parameter during SDK initialization (required in upcoming SDK v4). This enables automatic routing to v4.1 secure endpoints. Learn more about v4.1 →

Configuration Parameters

string
required
The client API key available in your Gameball dashboard (required).
string
required
The language code for SDK localization (e.g., “en”, “ar”, “fr”). Required.
string
Platform identifier, defaults to “flutter”.
string
Your Gameball shop identifier for multi-shop configurations.
string
Session Token for secure authentication (enables automatic v4.1 endpoint routing). Required in upcoming SDK v4.

Validation Rules

GameballConfig requires:
  • API key is required (cannot be null)
  • Language is required (cannot be null)

Example

Call init() before running your app to ensure the SDK is ready when your app starts.
Make sure to use your actual API key from the Gameball dashboard. Test keys are for development, production keys are for live deployment.

Next Steps