Skip to content

ARGameProject/cinadmin-game-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CinAdmin Game SDK

The official runtime SDK for CinAdmin AR games — one client surface, two language packages, generated from a single shared contract.

Package Language Install
@cinadmin/game-sdk TypeScript / JS npm install @cinadmin/game-sdk
com.cinadmin.game-sdk Unity / C# UPM Git URL (below)
game-sdk-contract OpenAPI + WS schema the source of truth both clients are built against

At showtime a runtime title does three things, and the SDK handles all three:

  1. Auth — exchanges a short-lived runtime session token and re-mints it transparently. It never embeds the long-lived cinadm_sdk_* build token (HC-01): you supply a token-provider callback that mints via your own broker.
  2. Discover / join — finds and joins the session running in a venue.
  3. The v2 WebSocket — live scores, game messages, player join/leave, with an offline queue that flushes on reconnect.

TypeScript / JS

npm install @cinadmin/game-sdk
import { CinAdminGameClient } from '@cinadmin/game-sdk'

const client = new CinAdminGameClient({
  baseUrl: 'https://api.cinadmin.com',
  webSocketUrl: 'wss://ws-v2.cinadmin.com',
  tokenProvider: async () => {
    // Your backend exchanges the build token at POST /api/v1/sdk/session-token
    // and returns the short-lived runtime token.
    const r = await fetch('https://your-broker.example/runtime-token', { method: 'POST' })
    return r.json() // { token, expiresAt }
  },
})

const [session] = await client.discoverSessions({ venueId: 'venue-123' })
await client.joinSession(session.sessionId!)
client.on('scoreUpdate', e => console.log(e.playerId, e.score))
await client.openSessionWebSocket(session.sessionId!)

Full quickstart: packages/game-sdk/README.md.

Unity / C#

In Unity, Window → Package Manager → + → Add package from git URL:

https://github.com/ARGameProject/cinadmin-game-sdk.git?path=/packages/game-sdk-unity

Pin a release by appending #game-sdk-v0.1.0. Integration guide: packages/game-sdk-unity/INTEGRATION.md.

Auth model (important)

Two tokens — keep them straight:

  • Build token (cinadm_sdk_*, ~90-day): your GP identity, issued once in the operator portal. Lives only in your backend. Never in an APK or the browser.
  • Runtime session token (~20-min JWT): the Bearer on every runtime call, minted by exchanging the build token. This is what the SDK uses, via your tokenProvider callback.

Versioning & the version floor

Both packages share one semver. The server may enforce a minimum supported version — a below-floor client is refused with 426 Upgrade Required (HTTP) or an UPGRADE_REQUIRED error frame (WS). See DISTRIBUTION.md.

License

UNLICENSED — © SSEL. Distributed for use by CinAdmin platform partners. See LICENSE.md.

About

Official runtime SDK for CinAdmin AR games — TypeScript (@cinadmin/game-sdk) + Unity (com.cinadmin.game-sdk). Token-exchange auth, discover/join, v2 runtime WebSocket.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors