JavaScript
1. Install through "script tag"
2. Initialize the SDK
Call the initialization functions at the start of your application:
You can also pass configuration options to control SDK behavior:
Configuration Options:
disable_startup_ads- When set totrue, prevents ads from automatically displaying at game startup. Useful for games that want full control over when ads are shown.
2.1. Bot ID Parameter
The initialize() method also accepts a botId as the first parameter:
When do you need to specify botId?
The botId parameter is not necessary if you're using our hosting and upload process. However, if you're hosting the game on your own server (which we don't recommend), you must add the botId parameter - it's important for authentication.
To find your game's bot ID, see How to find your game bot ID.
2.2. Initialize Overlay
Initialize overlay with default options or with startup configuration:
3. Call game-ready event
Call this method when the game is ready and visible to the user.
Notes: Initialization should occur as early as possible in your application lifecycle to prevent delays.
Local Testing
For instructions on how to test your game locally with full PortalSDK functionality (overlay, ads, IAPs), see the Local Testing Guide.