AikaHub.dev Studio öffnen

SDK-Referenz

Das vollständige @aikahub/sdk-README: Installation, Schnellstart, Cloud-Spielstände, Bestenlisten, Besuche, Präsenz, Fehler.

Die Referenz ist auf Englisch, derselbe Text, der mit dem Kit kommt.

Connect your game to AikaHub: Log in with AikaHub, the member's 3D (VRM) character, achievements, in-game rewards (entitlements), cloud saves (1.1.0; for Hub-hosted games over the cookie session since 1.3.0), server leaderboards (1.2.0) and visits with preset gifts (1.4.0).

  • ESM, no runtime dependencies, hand-written TypeScript types.
  • Runs in browsers, Cloudflare Workers, Node ≥ 18 and Deno.
  • Three entry points: browser (public PKCE client), same-origin (games hosted on aikahub.com), server (your game backend).

Full developer guide (EN/HU/DE): https://aikahub.com/developers

Install

Hosted single-file builds (CORS-enabled). In production, pin the exact version and check its integrity — the pinned path never changes, so the hash stays valid:

<script type="importmap">
{
  "imports": { "@aikahub/sdk/browser": "https://aikahub.com/sdk/1.5.0/browser.js" },
  "integrity": {
    "https://aikahub.com/sdk/1.5.0/browser.js": "sha384-ZdkngLNVEowz+7OzFPGsilk73u7krtJ6CW2JmeOn5H5ftcvPPPSrV/yOlmQbbuP9"
  }
}
</script>
<script type="module">
  import { createClient } from '@aikahub/sdk/browser';
</script>

The hashes of every file are in [/sdk/1.5.0/manifest.json](https://aikahub.com/sdk/1.5.0/manifest.json). Where import maps with integrity are not supported, or for desktop / packaged games, vendor the file (copy it into your build) instead of loading it from the Hub.

https://aikahub.com/sdk/v1/… always serves the newest 1.x (cached for a day) — handy while prototyping, but it cannot carry a fixed integrity hash. **SRI (integrity) only works with exact-version URLs** (/sdk/1.5.0/…): never put an integrity hash on a /sdk/v1/ URL — it breaks as soon as a new 1.x ships.

Files: aikahub-sdk.js (everything), browser.js, same-origin.js, server.js, manifest.json (sizes + SRI hashes). Note: the Hub is a single-page app, so a mistyped /sdk/… path may answer 200 with the Hub's index.html — the import then fails with a MIME-type / syntax error. Check the exact file name.

From source: copy packages/aikahub-sdk/ into your project (it is not on npm yet) and import { createServerClient } from '@aikahub/sdk/server'.

5-minute quickstart

0. Register your game

For now: write to info@aika.hu with your game's name, website and the exact redirect URI(s) (https://yourgame.example/auth/callback; desktop games may use http://127.0.0.1/<path> — any port is accepted). You get a client_id. Self-service registration in the AikaHub admin is coming.

1. Browser: log in

import { createClient } from 'https://aikahub.com/sdk/1.5.0/browser.js';

const hub = createClient({
  clientId: 'yourgame',
  redirectUri: 'https://yourgame.example/auth/callback',
  scopes: ['profile', 'achievements', 'character'],
});

// "Log in with AikaHub" button
loginButton.onclick = () => hub.login({ returnTo: '/play' });

// on the /auth/callback page
const session = await hub.handleCallback(); // checks state, exchanges the code with the PKCE verifier
if (session) location.replace(session.returnTo || '/');

Optional: the official button image (light / dark, SVG or PNG, EN/HU/DE — see aikahub.com/developers#brand for the usage rules: at least 40 px tall, clear space around it, don't recolour it):

<button id="aikahub-login" type="button" style="all: unset; cursor: pointer; line-height: 0">
  <img src="https://aikahub.com/developers/brand/aikahub-login-en-dark.svg" alt="Sign in with AikaHub" height="48" />
</button>
<script type="module">
  // `hub` = the client you created above (same module)
  document.getElementById('aikahub-login').onclick = () => hub.login({ returnTo: '/play' });
</script>

2. Use it

const me = await hub.me();           // { sub, nickname, avatarUrl, level, profileColor, profileUrl } — never an email
const char = await hub.character();  // { vrmUrl, thumbUrl, name, license, games: { peaceful, arena } }
await hub.unlock('first-steps');     // client-trust achievement (≤ 50 XP)
const { entitlements } = await hub.entitlements(); // [{ value: 'yourgame:ship-skin', … }]
await hub.logout();                  // revokes the refresh token at the Hub

3. Server: unlock with your game key

KEY="ahk_$(openssl rand -hex 32)"                  # keep this in your server's secrets — never in a client or repo
printf '%s' "$KEY" | sha256sum | cut -d' ' -f1     # upload ONLY this hash in the AikaHub Developer console (/developers/console)
import { createServerClient } from '@aikahub/sdk/server'; // or https://aikahub.com/sdk/1.5.0/server.js

const hub = createServerClient({ clientId: 'yourgame', clientKey: env.AIKAHUB_KEY });

// at login: your game client sends you its access token; check it was issued to YOUR game, store the sub
const user = await hub.verifyAccessToken(accessTokenFromClient);
await db.linkAikaHub(account.id, user.sub);

// later, when your server has verified the event
await hub.unlock(user.sub, 'yourgame:first-boss');      // server trust: up to 250 XP, legendary allowed
const { entitlements } = await hub.entitlements(user.sub);

4. Never lose an unlock: the retry queue

const queue = hub.queue({ store: myStore, onDrop: (job, err) => metrics.inc('aikahub_drop', { code: err?.code }) });
await queue.unlock(sub, 'yourgame:first-boss'); // tries now; on a transient error it stays queued
// every minute (cron / setInterval):
await queue.process();
ResponseOutcome
2xxdone — removed
409 not_linked, 403 (insufficient_scope, wrong_game, server_key_required), 400drop — final, removed, onDrop
401, 404, 408, 425, 429, 5xx, network error, timeoutretry — exponential backoff with jitter (2 s → 6 h), honours Retry-After (capped at maxDelayMs); dropped after maxAttempts (12)

Idempotency: the job key is deterministic (unlock:<sub>:<id>), so the same unlock is queued only once, and the Hub's unlock is idempotent (a repeat returns { new: false, xp: 0 }) — at-least-once delivery never gives double XP. A store is any object with get(key), put(job) (upsert), remove(key), list() and, optionally, claim(key, now, leaseUntil) → boolean; memoryStore() is built in. Before sending, the queue claims the job. Without claim() it re-reads the job and skips it if it is gone or leased — safe inside one queue instance, but **if several processes share one store, implement claim() as an atomic conditional update**. A job removed while it was being sent is never written back. Example on Cloudflare D1:

// CREATE TABLE aikahub_jobs (key TEXT PRIMARY KEY, job TEXT NOT NULL, next_at INTEGER NOT NULL, lease_until INTEGER NOT NULL DEFAULT 0);
const d1Store = (db) => ({
  async get(key) {
    const r = await db.prepare('SELECT job, lease_until FROM aikahub_jobs WHERE key = ?').bind(key).first();
    return r ? { ...JSON.parse(r.job), leaseUntil: r.lease_until } : null;
  },
  async put(job) {
    await db.prepare(`INSERT INTO aikahub_jobs (key, job, next_at, lease_until) VALUES (?1, ?2, ?3, ?4)
      ON CONFLICT(key) DO UPDATE SET job = ?2, next_at = ?3, lease_until = ?4`)
      .bind(job.key, JSON.stringify(job), job.nextAt, job.leaseUntil).run();
  },
  async remove(key) {
    await db.prepare('DELETE FROM aikahub_jobs WHERE key = ?').bind(key).run();
  },
  async list() {
    const { results } = await db.prepare('SELECT job, lease_until FROM aikahub_jobs ORDER BY next_at LIMIT 500').all();
    return results.map((r) => ({ ...JSON.parse(r.job), leaseUntil: r.lease_until }));
  },
  // atomic: exactly one worker gets meta.changes === 1
  async claim(key, now, leaseUntil) {
    const r = await db.prepare('UPDATE aikahub_jobs SET lease_until = ?1 WHERE key = ?2 AND lease_until <= ?3').bind(leaseUntil, key, now).run();
    return r.meta.changes === 1;
  },
});

Job keys contain the member's sub: do not log them.

5. Cloud saves (1.1.0, scope save)

Ask for the save scope (scopes: ['profile', 'save']). Each game gets up to 4 slots per member (main + 3 named, [a-z0-9-]{1,32}), each a JSON object ≤ 64 KB, at most 2 MB per member across all games. A game only ever sees its own saves. The easy way is the helper — it keeps a guest save, migrates it on login, holds the "one active session" lock and flushes on exit:

const save = hub.cloudSave({
  slot: 'main',
  // optional: when this device's save and the account save differ, the ACCOUNT wins unless you (the player) choose
  // 'local' here. `suggested` is only a hint (higher `progress`). Only 'local' replaces the account save (replace: true),
  // and the Hub then keeps the replaced one in the reserved 'backup' slot.
  resolveConflict: async ({ local, remote, suggested }) => ((await askPlayer(local, remote, suggested)) ? 'local' : 'remote'),
  onLockLost: (why) => showOverlay(why === 'taken_over' ? 'You continued on another device.' : 'Opened elsewhere.'),
});

try {
  await save.start();                      // tab lock (Web Locks) + Hub lease (90 s, heartbeat every 30 s) — call after login (stop() + start() when the member changes)
} catch (e) {
  if (e.code !== 'locked') throw e;        // "You're playing on another device — continue here?"
  if (await askTakeOver()) await save.start({ takeover: true });
}
const r = await save.sync();               // { source: 'empty' | 'local' | 'remote', data, rev, conflict, backup }
if (r.conflict) toast('We loaded your account save. This device’s progress is set aside — you can switch to it.');
startGame(r.data);

save.stage(state, { progress: state.day });   // every frame/tick is fine: local at once, Hub on flush()/exit
setInterval(() => save.flush(), 30_000);
await save.save(state, { progress: state.day }); // or right now (e.g. after a level)

save.backup();          // the side that lost the last merge (never discarded) …
await save.restoreBackup(); // … swapped in on the player's explicit request (the current one becomes the backup)
save.history();         // the last 3 local states that were overwritten from the account

// shared computer: remove this game's local copies when the player logs out
await hub.logout({ purge: true });  // or save.clearLocal() / save.clearLocal({ everyone: true })

With a custom storage (not localStorage), hub.logout({ purge: true }) cannot see it — call save.clearLocal({ everyone: true }) yourself. If the account save was deleted on another device while this device still has unsent changes, the next sync() uploads them as a new save (unsent local progress wins over a remote delete — nothing is lost; delete again if that was meant).

The helper's state (rev, lease, pending save) is bound to the member who was logged in at sync(): after a logout or a different member logging in, save() / flush() throw session_changed (or not_synced), stage() returns false and the exit flush sends nothing — call sync() again. Your own unsent changes (offline, closed tab) are uploaded on the next sync() only if the account save has not changed meanwhile; otherwise the account wins and they are set aside. The account list (hub.saves.list()) shows only this game's usage (usage.bytes) and a coarse usage.full flag, plus backup (the reserved slot: read / delete only, not one of the 4 slots, counts toward the 2 MB).

Rules the Hub enforces (they came from real data-loss bugs in Rókafalu, so the codes are distinct on purpose):

  • Every write needs If-Match: <rev> (0 = "there is no save yet") — no blind overwrite (428 rev_required, 409 rev_conflict with details.rev).
  • saveId (which world/run this is): a different one in the account → 409 other_save; progress (your monotonic progress number): lower than the account's → 409 stale_progress. Both need an explicit replace: true.
  • Lock: while another session holds a live lease, writes get 423 locked; after a takeover the old session gets 423 taken_over and must stop (the helper does); an expired lease nobody took is renewed (lease_expired, transparent).
  • 413 save_too_large (> 64 KB), 413 quota_exceeded (2 MB per member), 409 slot_limit (4 slots).
  • Disconnecting your game keeps its saves for 30 days (reconnecting brings them back), then they are deleted; deleting the AikaHub account deletes them at once.

Low level: hub.saves.get/put/remove/list/lock/unlock/beacon. From your server (the member must have granted save to your game): server.getSave(sub, slot), server.putSave(sub, slot, data, { rev }), server.deleteSave(sub, slot), server.listSaves(sub).

6. Leaderboards (1.2.0, scope scores)

Your game declares its boards (Developer console → Leaderboards, or the boards array of aikahub.config.json): { key, name: { hu, en?, de? }, sort: 'higher' | 'lower', format: 'points' | 'time_ms' | 'number', categories?: [...], trust: 'client' | 'server', reset: 'none' | 'weekly' | 'monthly', min?: 0, max }. While your client is in development, scores go to a sandbox that only you and your testers see; it is cleared when the game goes live on the Playground. Changes to a live game's boards are reviewed, like achievements.

const hub = createClient({ clientId, redirectUri, scopes: ['profile', 'scores'] });
const r = await hub.scores.submit('high', 1234, { category: 'mobile' }); // { best, improved, rank, status }
const top = await hub.scores.top('high', { category: 'mobile', period: 'current', limit: 10 }); // public when logged out
const me = await hub.scores.me('weekly'); // { rank, value, status, around: [... ±5, your row has me: true] }
  • Only each member's best per board × category × period is kept (sort decides what "best" means). A weekly board resets on Monday 00:00 UTC (ISO weeks, 2026-W46); period: 'previous' reads last week / month.
  • Values: finite numbers, whole for points and time_ms; below min → 400 score_out_of_range; above max on a client board → 400 score_out_of_range (impossible value). A server board only takes scores from your server (server.submitScore(sub, board, value, { category })); from the browser it answers 403 server_key_required.
  • Unusual results (above max on a server board, or a statistical outlier) are held for review: status: 'review', not public until a moderator approves. You (the owner) and your testers never appear on your live boards (status: 'hidden'), the same rule as "no XP from your own game".
  • Entries show nickname, avatar and level only (never an id or e-mail); members can choose to appear anonymously.
  • Limits: 120 submissions per member per game per hour (429 rate); top ≤ 100 rows, cached for 30 s.

From your server: server.submitScore(sub, board, value, { category }), server.scoreRank(sub, board, opts), server.topScores(board, opts); or durable: server.queue().enqueue('score', { sub, board, value, category }).

7. Visits + preset gifts (1.4.0, scope visits)

Other players can visit your member's home in your game and leave a gift from your preset list — there is no free text anywhere. Declare the gifts in the Developer console → Gifts (or the gifts array of aikahub.config.json): { key, name: { hu, en?, de? } }, and for pre-written cards { key: 'note-…', name, text: { hu, en?, de? } }. Like boards, a development client uses the draft in a sandbox (you + testers), and changes to a live game are reviewed.

const hub = createClient({ clientId, redirectUri, scopes: ['profile', 'visits'] });
await hub.visits.publish({ furniture, garden, doing: 'fishing' }); // ≤ 16 KB JSON, at most once per 5 minutes
const { homes } = await hub.visits.street();      // 6 neighbours: [{ handle, nickname, avatar, avatarUrl, level, updatedAt, followed }]
const house = await hub.visits.visit(homes[0].handle); // { data, character, nickname, level, counted, … } — validate data yourself
await hub.visits.gifts.send(homes[0].handle, 'note-thanks'); // { delivered, sentToday }
const { gifts } = await hub.visits.gifts.inbox(); // [{ id, key, at, from: { handle, nickname, … } }]
await hub.visits.gifts.ack(gifts.map((g) => g.id));
await hub.visits.settings.set({ visibility: 'followers' }); // 'all' (default) | 'followers' | 'none'
const { visitors } = await hub.visits.stats();    // today's distinct visitors
const { optedIn } = await hub.visits.overview();  // 1.4.1: true when the member's grant includes `visits`

Errors carry the Hub's extra fields in AikaHubError.details (1.4.1: on the same-origin path too):

try {
  await hub.visits.publish(snapshot);
} catch (e) {
  if (e.code === 'publish_too_soon') scheduleAt(e.details.nextPublishAt); // also e.details.retryAfter / e.retryAfter (seconds)
  else if (e.code === 'invalid_snapshot') console.warn(e.details?.reason); // same-origin: 'depth' | 'string' | 'key' | 'markup'
  else throw e;
}
Errordetails
429 publish_too_soonnextPublishAt, retryAfter
429 rejoin_limit (same-origin)rejoinAt (next UTC day), retryAfter
400 invalid_snapshot (same-origin)reason
409 already_gifted / 429 gift_limitlimits, sentToday (gift_limit)
  • The snapshot is opaque to the Hub (only size and JSON shape are checked): validate it with your schema when reading.
  • The Hub adds the host's public profile and Karakterem character (character, filtered like the explorer template: never Aika, never a licence that forbids peaceful games) — your game cannot forge them.
  • Other members are only known by an opaque **per-game handle**; you never get their sub, id or e-mail, and a handle from another game opens nothing in yours.
  • Visibility: all = every member who plays your game with visits; followers = only people who follow the host; none. Blocks are respected both ways; guests can never visit.
  • Limits: 1 gift per sender → host per day, 5 sent per day, 30 received per host per day (delivered: false above that); a visit counts once per visitor per day. The host gets at most one bell notification per day about visits and gifts.
  • Disconnecting the game (or re-authorising without visits) deletes the member's home, settings and gifts immediately.
  • From your server (game key): server.publishHome(sub, data), server.visitOverview(sub), server.giftInbox(sub), server.ackGifts(sub, ids). Street, visiting, sending gifts and settings need the member's own token (403 user_token_required).

8. Presence — "playing now" (1.5.0, scope presence)

Shows "playing <your game> now" on the member's AikaHub profile. It is on by default for every member, seen only by logged-in members (never by guests or through a public API), and the member can turn it off in AikaHub Settings — then the Hub accepts your heartbeats but stores nothing. Your game's AikaHub page shows only an anonymous, rounded count ("5+ members playing now" — 5+, 10+, 25+; nothing below 5; your own and your testers' sessions never count).

Policy: send presence only from the player's own client while they actually play. Keeping members "online" from a server (or by any other means) behind their back is a policy violation and can get your client's presence scope revoked.

const hub = createClient({ clientId, redirectUri, scopes: ['profile', 'presence'] });
const p = hub.presence.start({ state: 'menu' }); // a heartbeat now, then every ~50 s while the tab is visible
p.setState('playing');                           // 'menu' | 'playing' | 'idle' — no free text
await p.stop();                                  // stop + clear (also sent as a keepalive DELETE on pagehide)
// or by hand: await hub.presence.heartbeat('playing'); await hub.presence.leave();
  • The Hub keeps a member "playing" for ~90 s after the last heartbeat; send one every 45–60 s (start() does this, pauses while the page is hidden, and stops by itself on 401 / 403 / a final error — errors go to onError, never thrown).
  • One row per member — the last heartbeat wins (playing two games at once shows the latest). Same game + state within 30 s is not rewritten (stored: false). visible: false means the member turned presence off.
  • Other members see only the game's title on the profile — never the state or a timestamp. Blocks are respected both ways; banned and bot accounts never show.
  • A development client (sandbox) gets { stored: false, sandbox: true }: test players never show as really playing.
  • Presence needs the member's own token: the game key (Basic) gets 403 user_token_required — a server can't keep a member "online" behind their back.
  • Disconnecting the game (or re-authorising without presence) clears the member's presence for it immediately.

Games hosted on aikahub.com (same-origin)

import { createSameOriginClient } from '/sdk/1.5.0/same-origin.js';

const hub = createSameOriginClient({ game: 'lidercfeny' });
const { user } = await hub.start();   // who is logged in + uploads unlocks collected as a guest
const r = await hub.unlock('first-wave'); // never throws: { status: 'done' | 'queued' | 'dropped' }
const perks = await hub.entitlements();   // ['lidercfeny:extra-card']

1.4.0: Hub-hosted games on the visits list (Engawa Days: game: 'aikalife') get the same hub.visits API on the cookie session (/api/games/<game>/visits…). There is no consent screen on this path: ask the member in-game first, then send the first publish(data, { consent: true }) (or settings.set({ visibility, consent: true })) — without it the Hub answers 403 consent_required. hub.visits.leave() opts out (everything is deleted). Errors are thrown as AikaHubError (code = the Hub's code; 1.4.1: the Hub's error params in details, see the table above). 1.4.1: overview() returns optedIn (has the member consented in this game?) and, when true, consentAt — use it to decide whether to ask before the first publish.

1.5.0: hub.presence (the same API as above) on the cookie session (/api/games/<game>/presence) for the Hub's listed games (lidercfeny, aikalife). The Hub frame already sends presence while the member has the game open on aikahub.com, so a Hub-hosted game only needs hub.presence.start({ state }) / setState() if it wants to report menu / idle.

Cookie session, existing /api routes, client-trust achievements only. Guest unlocks wait in localStorage (only ids, never tokens) and are sent on the next logged-in start: up to 10 successes per start (the Hub allows 30 per hour per game), at most 30 attempts. Final errors — including 404 unknown_achievement, since definitions ship with the Hub — drop the entry; a transient error moves it to the back of the queue, and after 8 tries it is dropped. Untagged (guest) entries go to whoever logs in next on that browser. Entries queued while a member was logged in carry a short hash of that member's nickname and are only sent for them (other members skip them; they are dropped after 30 days).

Security notes

  • State + PKCE (S256) are mandatory and handled for you. The state and verifier live in sessionStorage for one tab, are single-use and expire after 10 minutes.
  • Tokens live in memory by default. storage: 'session' keeps them in sessionStorage so a reload does not log the player out — but then any XSS in your game can read them. The SDK never writes tokens to localStorage.
  • Refresh is single-flight: per instance, and across instances that share the stored session through navigator.locks (where available); inside the lock the stored tokens are re-read and adopted if another instance already rotated them. logout() waits for an in-flight refresh and revokes the newest token; a refresh that finishes after a logout or a new login is discarded (session_changed). Known limit: a duplicated browser tab copies sessionStorage and then lives on its own — a refresh in one tab makes the other tab's refresh token stale, and the Hub treats its reuse as theft (the family is revoked, the player logs in again). A short server-side grace period for refresh tokens is a Hub TODO.
  • No open redirect: the SDK never navigates after the callback; returnTo must be a same-origin relative path.
  • **baseUrl** must be https (http only for localhost). With discovery: true every endpoint must be on that origin.
  • The game key belongs on your server only. createServerClient refuses to run in a browser window or a browser worker (importScripts; an unknown WorkerGlobalScope — Cloudflare Workers and Deno are allowed), does not expose the key as a property, and the SDK logs nothing — no key, no Authorization header, no sub.
  • Always verify on your server that an access token was issued to your game (verifyAccessToken checks aud).
  • The sub is pairwise: the same member has a different sub in every game. The Hub never shares email addresses.

Errors

Every failure is an AikaHubError with code, status (0 for network / client-side checks) and final (true = retrying will not help). classify(error) returns 'done' | 'drop' | 'retry'.

codestatusmeaning
invalid_token401access token expired or revoked (the browser client refreshes once automatically)
invalid_client401wrong game key (retried: may be a key rotation)
invalid_grant400code or refresh token invalid / reused — log in again
insufficient_scope403the member did not grant this scope
wrong_game403the achievement belongs to another game
server_key_required403server-trust achievement unlocked without the game key
not_linked409the member unlinked your game — drop it
unknown_achievement404not (yet) defined on the Hub
rate429rate limited; see retryAfter
state_mismatch, login_expired0callback did not match a login started in this tab
access_denied0the member pressed "No"
wrong_audience401the access token was issued to a different game
session_changed0a refresh finished after logout / a new login; its result was discarded
network_error, timeout0retry later
rev_required428save write without If-Match (rev)
rev_conflict409the save changed meanwhile — details.rev is the current one; read it again
other_save / stale_progress409a different saveId / lower progress than the account's save — needs replace: true
slot_limit409more than 4 save slots in this game
locked / taken_over / lease_expired423another session plays now / this session was taken over / your lease expired
save_too_large / quota_exceeded413save > 64 KB / member over 2 MB across all games
no_save404empty slot (get() returns null)

License and agreement

The SDK is licensed under the AikaHub SDK License (not open source): https://aikahub.com/developers/sdk-license (see LICENSE.md; all versions with SHA-256 fingerprints: https://aikahub.com/developers/legal). Connecting a game to AikaHub also requires the AikaHub Developer Agreement, accepted in the Developer console (https://aikahub.com/developers/console). Both are in Hungarian and English; the Hungarian version controls.

Roadmap

  • Done (1.1.0, Hub Platform API 2a): cloud saves, save lock (one active session), guest → account save migration.
  • Done (1.2.0, Hub Platform API 2b): server leaderboards (scores), weekly / monthly periods, categories, sandbox.
  • Done (1.4.0, Hub Platform API 2d): visits (visits) — home snapshot, street, preset gifts, inbox; same-origin too.
  • Done (1.4.1): optedIn / consentAt in the visits overview; same-origin errors carry details (nextPublishAt, rejoinAt, reason, …).
  • Done (1.5.0, Hub Platform API 2c): presence (presence) — "playing now" heartbeats with Page Visibility; same-origin too.
  • TODO: same-origin leaderboards in the SDK (aikahub.com games call POST /api/scores/submit directly today).
  • TODO: same-origin cloud saves (games on aikahub.com use their own /api routes today).
  • Done (AikaHub 11.41): self-service client registration and key-hash upload in the Developer console.
  • TODO: publish to npm (under the AikaHub SDK License, from 1.0.1 on). /sdk/1.0.0/ stays online unchanged and remains available under MIT, as published.

Development

(cd packages/aikahub-sdk && npm test)              # unit tests (mocked fetch)
node --test tests/sdk-*.test.mjs                   # against the Hub's real handlers + hosting checks (Node 22)
npm run sdk:build                                  # rebuild public/sdk/v1/ and public/sdk/<version>/

See CHANGELOG.md.