Skip to main content

Initialize the SDK

Initialize Gameball at app startup, typically in your root component or App.tsx:
🔒
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
Language code: ‘en’ or ‘ar’ (required).
string
Your Gameball shop identifier for multi-shop configurations.
string
Platform identifier (optional, set if you manage multiple platforms).
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)

Using Async/Await

You can use async/await for initialization if needed:
Initialize the SDK as early as possible in your app’s lifecycle to ensure it’s ready when you need to track events or show the profile widget.
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