Quickstart
Learn how to register and manage games, fetch data from the API, and submit points for players.
0. Prerequisites
1. Register a Game
try {
const game = await ogp.games.register({
name: 'My Game Name',
description: 'A description of more than 10 characters',
gameUrl: 'https://mygame.com',
platform: 'HTML', // 'HTML' or 'EXTERNAL_URL'
isHTMLGame: true, // Optional: Defaults to True
iframable: true, // Optional: Defaults to True
twitter: 'https://x.com/mytwitter', // Optional
discord: 'https://discord.gg/invite', // Optional
telegram: 'https://t.me/mychannel', // Optional
maxScorePerSession: 0, // Optional: 0 or null = Unlimited
maxSessionsPerDay: 0, // Optional: 0 or null = Unlimited
maxCumulativePointsPerDay: 0, // Optional: 0 or null = Unlimited
base64Image: '...', // Required if not passing image file
base64CoverImage: '...', // Optional
});
console.log('Game registered:', game.id);
} catch (e) {
throw e;
}Interacting with the Game API
Verify Game Ownership
2. Submit Points for Players
Single Player
Batch Save (Multiple Players)
Player Identifier Formats
Format
Example
Description
Response Format
Important Notes
3. Validate Session Tokens
Response Format
Important Notes
4. Query Points & Leaderboard
Last updated