@bunchagames/sdk
v0.1.0
Published
Buncha Games browser SDK facade, types, mocks, and engine adapters.
Readme
Buncha Games SDK
@bunchagames/sdk is a small facade for browser games published on Buncha Games.
In Buncha Games Sandbox and public play, the platform runtime exposes window.buncha. This package gives web games typed helpers, local mocks, and engine adapter files for development. It does not contain secrets and does not grant production monetization access.
Web usage
import { buncha, installLocalBunchaMock } from "@bunchagames/sdk";
if (import.meta.env?.DEV && !globalThis.window?.buncha) {
installLocalBunchaMock();
}
buncha.ready();
buncha.game.start({ mode: "arcade" });
buncha.analytics.event("boss_defeated", { bossId: "forest_king" });
buncha.game.end({ score: 1200 });Player profile
import { buncha } from "@bunchagames/sdk";
const player = await buncha.player.getProfile();
if (player.signedIn) {
showPlayerName(player.profile.displayName);
}Sandbox test mode
Sandbox wallet, IAP, entitlement, and ad test methods are optional and fake/non-payable. Check that the method exists before showing test UI.
const wallet = await buncha.wallet?.getSandboxSummary?.();
const catalog = await buncha.iap?.getSandboxCatalog?.();Engine adapters
- Unity WebGL: copy
adapters/unity/BunchaGamesSdk.csandadapters/unity/BunchaGamesSdk.jslibinto your Unity project. - Godot Web: copy
adapters/godot/buncha_games_sdk.gdinto your Godot project.
The adapters no-op outside web exports.
