New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

@idosgames/core

Package Overview
Dependencies
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@idosgames/core

Engine-agnostic core of the IDosGames SDK (transport, auth, cache, services, events).

Source
npmnpm
Version
0.21.1
Version published
Weekly downloads
177
-74.71%
Maintainers
1
Weekly downloads
 
Created
Source

@idosgames/core

Engine-agnostic core of the IDosGames SDK — HTTP transport, authentication, local cache, 24 feature services, and a typed event bus. It knows nothing about any rendering engine (Three.js, Phaser, React…), so it works in any browser or JS runtime.

  • Typed end to end. Every backend response is validated at runtime with zod before it reaches your code; the published type declarations are flat and lightweight.
  • No exceptions on expected failures. Service calls return a discriminated OperationResult<T> ({ ok: true, data } or { ok: false, reason, error }).
  • One client owns the whole graph. Create it once; reach every service and the local cache from it.

Install

npm install @idosgames/core

Peer runtime deps (zod, decimal.js) are installed automatically.

Quick start

import { createIDosGamesClient, isOk } from "@idosgames/core";
import { BrowserPlatformAdapter } from "@idosgames/core/platform";

const client = createIDosGamesClient({
  titleID: "YOUR_TITLE_ID",
  platform: new BrowserPlatformAdapter(), // storage + platform integration
});

// Authenticate (device id, Telegram, email, Google, or a platform token).
const login = await client.auth.loginWithDeviceID();
if (!isOk(login)) {
  console.error("login failed:", login.reason, login.error);
}

// Call any service — results are discriminated, never thrown.
const res = await client.currency.convert(
  "Virtual",
  "GOLD",
  "Virtual",
  "GEM",
  100,
);
if (isOk(res)) {
  console.log("credited:", res.data.TargetCredited);
}

// Read the local cache and react to changes via the typed event bus.
const off = client.on("currency:converted", (payload) => {
  console.log("balances updated", payload);
});
// later: off();

What's on the client

client.auth, user, currency, item, store, purchase, checkout, lootbox, reward, quest, tutorial, analytics, experiments, communityMarketing, chat, push, localization, timedEvent, leaderboard, season, premium, character, match, craft, ai, collection, coopEvent, dealOffer, referral, social, timedBoost, userCustomData, titleCustomData, title, gameLoop, cloudCode, blockchain, marketplace, multiplayer, workshop, dataCollections — plus client.data (local cache) and client.on/once/off (events).

Entry points

ImportWhat
@idosgames/coreclient, services, models, result & event types
@idosgames/core/platformplatform adapters & storage (BrowserPlatformAdapter, NoopPlatformAdapter, BrowserStorage, MemoryStorage)

Versioning

Semantic versioning. While on 0.x the public API is still stabilizing, so breaking changes may land in a minor bump — see CHANGELOG.md. The backend HTTP API version (/api/v2/…) is independent of this package's version.

License

MIT © iDos Games

Keywords

idosgames

FAQs

Package last updated on 05 Oct 2026

Related posts