Launch your Game
Embed your game on your website and configure the necessary user authentication token
To launch your game, you must first embed the game on your website. The game becomes available to your users after the campaign start date you configured in the campaign settings.
Embed your game on your website before the start date so you can test its functionality before the game is launched.
Game URL Structure
The game URL requires a dynamic token parameter to identify each user. This URL is on every page of your campaign and has the following format:
https://game-type.games.xtremepush.com/play/project_id/campaign-name?token=34523453
game-type: Type of game you have configured, for example, penalty-shootout or scratchcards.campaign-name: Name of your campaign.token: The game URL on the platform contains a placeholder token that you must replace when embedding the game on your website.
The unique token identifies each user, allowing Xtremepush to personalize their game experience or track interactions. As the website owner, you're responsible for generating or retrieving the correct token for each user and appending it to the game's URL.
Token Parameter
The game URL requires a token parameter to identify the user. You can add this token in two ways:
- User ID: The simplest approach is to dynamically append the user ID as the token parameter as shown below:
https://game-type.games.xtremepush.com/play/1/campaign-test-1?token={{user.id}}. - JWT Authentication: Alternatively, you can use a JSON Web Token (JWT) for the token parameter.
Using a JWT offers greater security for your game integration. Unlike a standard User ID, a JWT is cryptographically signed. This signature creates a secure method for verifying the user's identity and ensures that the data transmitted between your website and the game is authentic and trusted.
This security relies on a secret key, which you can generate in the game settings or manually provide your own. This secret key allows your system to sign the token. The game platform uses this same key to verify the signature, confirming that the request originated from you and has not been altered.
Additionally, using a JWT allows you to set an expiration time for the token. This ensures that game links are only valid for a specific period, preventing users from accessing the game through old or shared links once the session closes.
URL Restrictions with JWT AuthenticationWhen JWT authentication is enabled, the direct Game URL, displayed in the game's backend, will not load the game because it requires a valid, signed token. You must embed the game on your website to generate the token and access the game.
Therefore, we do not recommend using JWT for test projects where you need quick, direct access to the game via the URL in the game's backend.
For more information on how to add a JWT token, see JWT Authentication details.
Updated 3 days ago