Game Integration Setup Guide
Objective: To enable users to connect their game accounts to Ludo Rewards, access their rewards, and integrate with Discord.
Step 1: User Login
Action: Implement a 'Login to Ludo Rewards' button in your game's user interface.
Process: When this button is clicked, initiate an HTTP GET request to the Ludo Rewards login endpoint with the player's unique ID and customer ID.
Parameters:
playerId
(Player's unique ID)customerId
(Player's unique customer ID from Ludo)
Example Endpoint:
https://{ludorewards_url}/api/v1/auth?playerId=12345&customerId=67890
Expected Response: The response will include
session_token
,discord_user_id
andplayer_id
which is used for further authentication.
Sample Code:
Step 2: Checking Login Status
Action: After logging in, call the
/me
endpoint to confirm the user's login status.Headers: Include the received
session_token
in the request headers for secure authentication.Expected Response: The response includes
playerId
andid
, the Ludo user ID.
Sample Code:
Step 3: Logging Out
Action: Implement a logout functionality.
Process: Call the
/logout
endpoint with the user'ssession_token
to log the user out.Headers: Include the
session_token
in the request headers.
Sample Code:
Additional Steps:
Storing User Data: Securely store the received
session_token
,playerId
, andludoUserId
in your game's database.Error Handling: Implement error handling to manage scenarios where the connection process fails.
Displaying Rewards and Discord Integration: Provide options in your game's UI for users to view their rewards and check their Discord integration status.
Note: Ensure that the provided URLs, endpoints, and parameter names align with your specific implementation. Test thoroughly to ensure a smooth user experience.
Last updated