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 Options:
// web | ios | android | steam | itch | epic
platform: "web",
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 = Unlimited
maxSessionsPerDay: 0, // Optional: 0 = Unlimited
maxCumulativePointsPerDay: 0, // Optional: 0 = Unlimited
base64Image: "...", // Required if not passing image
base64CoverImage: "...", // Required if not passing coverImage
// Optional: Define rewards allocation, must add up to 10,000 basis points.
orgRewardsSplit: {
"solana_address_1": 5_000,
"solana_address_2": 5_000,
},
});
} catch (e) {
throw e;
}Interacting with the Game API
Verify Game Ownership
2. Submit Points for a Game
Interacting with the Play API
Last updated