0xDocs 0x.limo

Docs / Monetization

Subscriptions

Switched off on 0x.limo

Sell weekly, monthly or yearly plans for your game, paid from the player's 0x balance; check entitlement keys in the game (@0xlimo/platform/launcher) and on your server (@0xlimo/platform/server).

Sell a monthly subscription for your game, with optional weekly and yearly prices. Players pay from their 0x balance, and 0x renews the subscription every period. Your share of each charge is settled like a game sale. Each plan unlocks an entitlement key that your game checks.

Switched off on 0x.limo

Subscriptions are deployed but switched off on 0x.limo. While they are off, every subscription route answers 404, and the launcher shows no plans. Server-side checks also need play tickets, which are off on 0x.limo too (see the paygate). You can build against @0xlimo/platform now. This callout goes away when subscriptions are switched on.

#1. Create plans

On 0x, open Subscription plans (https://0x.limo/plans). Each game can have up to 10 plans:

FieldRules
Name, descriptionWhat players see on the game page and in the subscribe dialog (description up to 500 characters).
Entitlement keyWhat your game checks, e.g. vip, season-2, perks.gold: 1–64 characters of lowercase letters, digits and _ . : -, starting with a letter or digit. It never changes once the plan exists.
PricesMonthly (required), weekly and yearly (optional), in US cents, from 99 to 100000. A new price applies to new subscribers; current subscribers keep theirs.

Retire a plan to stop new subscriptions. Current subscribers keep renewing until they cancel.

The same operations over the API, with your 0x account's token:

text
POST /v1/dev/apps/<appid>/plans                 {"name": "VIP", "entitlement": "vip", "prices": {"month": 499, "year": 4999}}
PUT  /v1/dev/apps/<appid>/plans/<plan id>       {"active": false}            (also name, description, prices)
PUT  /v1/dev/apps/<appid>/subscription          {"only": true}
GET  /v1/dev/subscriptions                      your games, plans and subscriber counts

Plan ids look like pl_ followed by 12 hex digits. The catalog (GET /v1/catalog) carries a game's active plans as store.subscription = {only, currency, plans}.

#Subscription-only games

When subscription-only is on, the game can't be bought (409 subscription_only): owning it means holding an active subscription to any of its plans. Subscribers see Play, get play tickets, pass the hosted-site gate, and own the game for the Steam-compatible licence check. When a subscription lapses, the subscriber loses access. Without subscription-only, a free or paid game stays as it is, and its plans only unlock their entitlement keys.

#2. What players get

  • Subscribe: the first period is paid from the balance at once. Renewals fall on the same calendar day each week, month or year, in UTC (Jan 31 → Feb 28 → Mar 31).
  • Renewal: 0x charges the next period on that day. Three days before, the player gets a notice in the launcher, and a second one if their balance won't cover the charge.
  • Balance short: 3 days of grace with access, retried every 12 hours. After that the subscription is paused (no access) until the player resumes it, and a new period starts on that day.
  • Cancel: takes effect at the end of the paid period, and the player can undo it until then. Canceling during grace or while paused ends the subscription at once.
  • Refunds (0x support): the period's price goes back to the player's balance and your share is taken back. Refunding the current period ends the subscription.

A player can hold several plans of your game, one subscription per plan. Free trials and coupons don't exist yet.

#3. In the game: ask the launcher

A game opened from the 0x launcher runs in its frame. @0xlimo/platform/launcher asks the launcher about the signed-in player. The game never sees the player's token, and anything that costs money is confirmed by the player in the launcher's own dialog.

js
import { createLauncher } from "@0xlimo/platform/launcher";
const launcher = createLauncher();

const s = await launcher.subscriptions.status();
// {entitlements: ["vip"], subscriptions: [{plan_name, status, current_period_end, ...}], plans: [...], signedIn}
if (await launcher.subscriptions.has("vip")) unlockVipSkins();

// your own "Go VIP" button; the launcher asks the player to confirm
const r = await launcher.subscriptions.subscribe(s.plans[0].id, "month");
if (r.outcome === "subscribed") unlockVipSkins();   // also "already_subscribed", "canceled", "insufficient_funds" (the dialog offers a top-up), "signed_out", "failed"

launcher.on("subscription.changed", (e) => refresh(e.entitlements));

Outside the launcher (the game opened in its own tab, or local development), status() rejects with a LauncherError whose code is no_launcher, and has() returns false. A player who edits the page can bypass a check in the browser, so for anything that matters, check on your server.

#4. On your server: check the entitlement

The client gets a short-lived play ticket from the launcher and sends it to your server. The server asks 0x who the player is and which keys they hold:

js
// client
const ticket = await launcher.playTicket();
socket.emit("hello", { ticket });

// server (Node 18+)
import { checkTicket } from "@0xlimo/platform/server";
const API = "https://api.0x.limo";
io.on("connection", (socket) => socket.on("hello", async ({ ticket }) => {
  const who = await checkTicket({ api: API, ticket, appid: MY_APPID });   // {valid, steamid, entitlements}
  if (!who.valid) return socket.disconnect();
  socket.data.vip = who.entitlements.includes("vip");
}));

Tickets last 5 minutes, so check again when the player reconnects. hasEntitlement({api, ticket, entitlement}) is the boolean shortcut.

A native game server signed in to the backend asks directly, for players of its own game only. It uses a game-server session from POST /v1/gameservers/logon:

js
import { serverEntitlement } from "@0xlimo/platform/server";
const r = await serverEntitlement({ api: API, session, steamid, entitlement: "vip" });   // {entitled, entitlements}
// GET /v1/gameservers/entitlement/<steamid>/<key>   (Authorization: Bearer <session>)

#5. Hosted sites of subscription-only games

A subscription-only game hosted on 0x (0x publish) is gated like a paid one by x1-paygate: only subscribers get in, and everyone else sees a "Subscribe to … on 0x" page. Passes for these sites last at most an hour, so a lapsed subscriber is locked out within the hour. The paygate is not deployed on 0x.limo yet.

#Questions

QuestionAnswer
Currencies?US dollars, paid from the 0x balance (topped up by card, settled in USDT or Bitcoin).
What does the game see while a payment is late?The key stays during the grace days. Once the subscription is paused, the key is gone until the player pays.
Can I change a plan's key?No. Create a new plan and retire the old one.