Inspacy Auto Packaging
Guide version 1.10.0
Choose ownership protection
Choose one ownership mode for each Windows build. Player sign-in and automatic playtime have their own switches.
Before you start
- A publisher account with a confirmed email address.
- A ZIP containing a Windows x86 or x64 game executable that runs on 64-bit Windows, and its path inside the archive.
Steps
- You can create a private draft with just a game title and short description. To set up Windows packaging during registration, open Platforms and other settings, then Windows packaging. Choose No DRM for direct start, Integrated DRM for your own receiver, or Automatic DRM to encrypt a Windows build. You can also choose this when uploading a build.
- Configure player sign-in separately if the game opens a session on your backend.
- Upload the ZIP and follow its build status. Preview the exact build before publishing it.
Example
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "list_my_game_builds",
"arguments": {
"gameId": 42
}
}
}Expected result
The returned build includes its approval status and any action still required.
If something goes wrong
If the build failed validation, correct the reported file in your source and upload a new build.
Integrate DRM
Use a fresh ownership proof when your Windows game must stop before gameplay on direct launch.
Before you start
- Download the C# reference game below and install the .NET 10 SDK.
- Obtain the store verification roots for your deployment and your numeric game ID.
Steps
- Read the startup check in Program.cs and compile your game ID and trusted roots into your production receiver. The sample reads receiver-settings.json beside its executable to configure a test build.
- Verify the manifest, its signature and the selected executable. Before entering a menu or loading a save, issue a fresh challenge on the launch pipe and validate the returned proof for this game and build.
- Build the sample, package it with integrated protection, then install and start the publisher preview. Run the protected executable directly and record the result for that build in the desktop app.
Example
dotnet publish ReferenceGame.csproj -c Release -r win-x64 --self-contained true -p:PublishSingleFile=trueExpected result
Authorized preview reaches ENTERED_GAMEPLAY. Direct start exits with DENIED before gameplay.
If something goes wrong
A missing launch pipe, changed installed file, unknown signing key or expired proof stops startup. Reinstall the verified package and request a fresh launch.
Download reference-game.zipProtect a Windows build with Automatic DRM
Distribute an encrypted copy of your Windows game. The player signs in to Inspacy and launches it online. The launcher checks access for this game and build before it unpacks any game files.
Before you start
- Export your game from any engine that produces a Windows x86 or x64 executable. Put the executable, libraries and assets in a ZIP with their original directory layout. Select the executable that stays open during play and enter its path inside the ZIP.
- Use a persistent per-user location for saves and settings. The game's launch directory is temporary.
Steps
- Select Automatic DRM in Windows packaging and upload the ZIP. For the command below, use Python 3.11+ and the upload script from publishing skill 1.4.0. Replace 42, game.zip and Game.exe with your game ID, archive and executable path.
- The launcher applies Automatic DRM and records playtime when selected, with no game code changes. To identify players, enable player sign-in and add code that reads the one-use ticket and sends it to your backend for redemption. Select the beta and membership options when the game needs those decisions.
- On the desktop app, install and start the publisher preview for this exact build. Check that the game opens, loads its assets and can read a save after closing and reopening it.
- On clean Windows, check that the installed package contains no unpacked game executable and that a signed-out or unentitled account cannot start gameplay. Record the direct-launch check on the build and publish after its required checks pass.
Example
python scripts/upload.py --game 42 --zip game.zip --entry Game.exe --drm automatic --auto-playtime --state game-upload.jsonExpected result
The authorized launch opens your original game and reports playtime when enabled. The launcher checks access again if the installed package is copied. During authorized play, a user can read and keep a copy of the temporarily extracted files.
If something goes wrong
For a rejected upload, check the build's failure reason, the selected executable path and the ZIP contents. For a denied launch, sign in with the publisher account for a preview or an entitled player account for a published build.
Sign players in to your service
The packaged game receives a single-use ticket. Your backend redeems it and creates your own player session.
Before you start
- Choose a public key ID for this game, such as arena-prod. Enter it in the Windows sign-in settings during registration or editing. Once the draft exists, open Redemption credentials, create a credential with that same ID and store the one-time secret on your backend.
- Environment delivery requires Play.exe 0.4.0 or later. The Windows receivers in the C#, C, C++ and Rust SDKs 1.3.0 support environment, named-pipe and argument delivery.
Steps
- Enable player sign-in at registration or in packaging settings. Choose environment delivery and enter your variable name, for example INSPACY_GAME_ARENA_LOGIN. Start with INSPACY_GAME_ followed by 1 to 27 uppercase letters, digits or underscores, beginning with a letter. INSPACY_GAME_ID is reserved.
- At startup, take the opaque ticket from that variable and remove it before starting child processes. For named-pipe delivery the configured login flag carries the pipe name. For argument delivery the flag carries the ticket. Forward the ticket to your game's HTTPS backend.
- On the backend, send { "ticket": "…" } to POST /api/store/tickets/v1/redeem with your secret in X-Api-Key. Only open a retail session after successful redemption for your expected game and purpose play. Preview uses a separate identity. With Automatic DRM, Play.exe verifies the launch proof for your game. With Integrated DRM, your receiver verifies it with Inspacy’s public roots.
- The response identifies the player by a subject specific to your publisher. It includes owned content and expansions. Enable the beta or subscription options to receive those decisions. For current access and this game's total playtime, use the publisher player lookup. Use the separate friends endpoint to discover eligible friends who also play this game.
Example
# Windows game (Python 3, automatic DRM)
import os
ticket = os.environ.pop("INSPACY_GAME_ARENA_LOGIN", None)
if not ticket:
raise RuntimeError("Player sign-in required")
# Your game implements start_game_session to send the ticket to its HTTPS backend.
session = start_game_session(ticket)Expected result
The backend accepts the first valid redemption and can read membership.active when the build requested subscription status.
If something goes wrong
A fabricated, expired, spent or wrong-game ticket cannot create a player session. Start the game again for a fresh ticket. Record the outcome without logging the ticket or secret.
Download reference-game.zipMeasure online playtime
An entitled player and the game’s authenticated backend can read the accumulated playtime. Overlapping devices count once.
Before you start
- For packaged Windows builds, select automatic playtime in the game defaults or on this upload.
- For your own standalone writer, use a game-player access token and generate a random session UUID.
Steps
- For a packaged build, let the desktop launcher send its own observations. Test using the exact publisher preview, then inspect the build’s playtime approval.
- For standalone play, send start with sequence 0, heartbeat about every 30 seconds with an increasing sequence, and end when the player leaves. Retry a lost response using the same session ID and sequence.
- Read totalSeconds from the game’s /me endpoint. The player can also see their accumulated time on the store game page.
Example
curl --fail-with-body -X POST "$INSPACY_API_ORIGIN/api/store/game-runtime/v1/42/playtime/$SESSION_ID/events" -H "Authorization: Bearer $GAME_PLAYER_TOKEN" -H "Content-Type: application/json" --data '{"kind":"start","sequence":0}'Expected result
Only confirmed online intervals count. The preview records an approval and adds zero seconds.
If something goes wrong
An interval longer than 90 seconds adds no time for the gap. Stop on entitlement loss or sign-out. Limit retries after 429 using Retry-After.
Read beta access
Use the same game-scoped access decision for an Inspacy key or a key supplied by the publisher.
Before you start
- Configure the beta source, eligible channel and displayed end date. The player buys and redeems the key on web or desktop.
Steps
- Read the decision using the signed-in game session. A publisher backend with a game-bound credential can query the player subject returned at sign-in.
- For packaged Auth, select Include beta access and read betaAccess on ticket redemption. With Auth off, select the beta option and read INSPACY_GAMESTORE_BETA_ASSERTION from the game process. Verify the store signature and the game, build, purpose, nonce and expiry before using beta.state, beta.programId or beta.expiresAt.
- Use the exact build preview and the receiver sample to confirm the handoff. Check current access again before serving protected beta content.
Example
curl --fail-with-body -H "Authorization: Bearer $GAME_PLAYER_TOKEN" "$INSPACY_API_ORIGIN/api/store/game-runtime/v1/42/me/beta"Expected result
An active redeemed beta reports its program and expiration. The retail entitlement is separate.
If something goes wrong
After refund, revocation or expiry, refuse beta content. For publisher-issued keys, reconcile external redemption and revocation with the authorized publisher backend.
Download reference-game.zipCheck the game’s monthly membership
Read a game-specific membership decision before enabling the benefits described in the publisher’s offer.
Before you start
- Configure the monthly title, benefits and price on the game. The player enrolls in the hosted checkout on web or desktop.
Steps
- Use the player’s game session for the request below. On your backend, use the game-bound credential and the returned subject for the same current decision.
- For packaged games, enable Auth and Report subscription status on the build. Redeem its single-use ticket on your backend and read membership.active, asOf and validUntil.
- Recheck at the paid-through boundary and after a refund. Keep premium decisions on the backend.
Example
curl --fail-with-body -H "Authorization: Bearer $GAME_PLAYER_TOKEN" "$INSPACY_API_ORIGIN/api/store/game-runtime/v1/42/me/membership"Expected result
A verified paid invoice opens its covered interval. An unpaid renewal expires at the end of the paid period.
If something goes wrong
A checkout return alone grants no benefits. Query again after payment verification. A canceled membership can remain active until its paid-through date.
Find friends in your game
Friend discovery is available to every game from January 1, 2027 at 00:00 São Paulo time, when the approved policies take effect. Sharing starts on for each player and game.
Before you start
- Use a player OAuth session for this game, or redeem a retail launch ticket on your backend with its game-bound key. Friend discovery requires no publisher switch at registration.
Steps
- Once the policies take effect, two accepted friends must each sign in to this game through Inspacy and both keep sharing enabled. Players can turn sharing off or back on from the game page or library on web, mobile and desktop, even before first launch.
- From the game, call GET /api/store/game-runtime/v1/{gameId}/me/friends with its player bearer token. Automatic Windows sign-in can instead send the one-use ticket to your backend, which redeems it before looking up that player.
- On your backend, call GET /api/store/game-access/v1/{gameId}/players/{subject}/friends with the game-bound X-Api-Key and the authenticated retail subject. Preview identities cannot read this list.
- Read self and friends as game-specific aliases. Continue with ?cursor= and the encoded nextCursor until it is null. Turning off sharing removes a player from both sides. Turning it back on gives the player a fresh alias.
Example
const friendIds = []
let cursor = null
do {
const page = await player.friends(cursor)
friendIds.push(...page.friends)
cursor = page.nextCursor
} while (cursor !== null)Expected result
Up to 50 game aliases per page, with no global ID or profile data.
If something goes wrong
Before the policies take effect, before the player signs in to the game for the first time under those policies, or while sharing is off, the response contains a null self and an empty friends list. Fetch the current list when showing it in the game.