Quickstart

Learn how to register and manage games, fetch data from the API, and submit points for players.

0. Prerequisites

This guide assume you've followed the setup guide from the previous page.

1. Register a Game

First, we will register a new game on the OGP Platform

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

Without claiming game ownership, you will only earn 5% of allocated creator rewards. By claiming ownership, you gain access to the full creator rewards allocation.

To verify game ownership, you will need to embed the following meta tag in the head of your game URL webpage:

Once this is in your webpage head, call the following via the client:

2. Submit Points for a Game

To submit points for users use the client and include points record data

Interacting with the Play API

Last updated