SDK Overview
The Globio SDK is the official JavaScript/TypeScript client for the Globio platform. It gives your game direct access to all Globio services from a single initialized client.
Installation
npm install @globio/sdkOr from JSR:
npx jsr add @globio/sdkQuick start
import { Globio } from '@globio/sdk';
const client = new Globio({
apiKey: 'glo_client_your_key_here',
});Your API key is available in the Globio Console under your project’s API Keys section. Use your client key — never expose your server key in client-side code.
Services
Once initialized, all services are available as properties on the client instance:
| Property | Service | Description |
|---|---|---|
client.id | GlobioId | Authentication and user management |
client.doc | GlobalDoc | Document database |
client.vault | GlobalVault | File storage |
client.pulse | GlobalPulse | Feature flags and remote config |
client.scope | GlobalScope | Analytics and event tracking |
client.sync | GlobalSync | Real-time multiplayer rooms |
client.signal | GlobalSignal | Push notifications |
client.mart | GlobalMart | Game economy and payments |
client.brain | GlobalBrain | AI agents and LLM routing |
client.code | GlobalCode | Edge functions and GC Hooks |
TypeScript
The SDK ships its own TypeScript types — no separate @types/globio package is needed.
import { Globio } from '@globio/sdk';
// Types are included automaticallyEnvironment support
| Environment | Support |
|---|---|
| Browser | ✅ Full support |
| Node.js | ⚠️ Partial — fetch-based calls work, offline persistence does not |
| Cloudflare Workers | ⚠️ Partial — same caveat as Node.js |
| React Native | ❌ Not supported |
The SDK includes an offline persistence layer that uses IndexedDB. This is browser-only. In Node.js or edge runtimes, basic service calls work correctly but offline/cache behavior should not be relied on.
For server-side usage in Node.js or Cloudflare Workers, use your server key via direct API calls or the CLI instead.
