@gamevault/sdk
v2.0.0
Published
GameVault SDK - Unified API for game asset marketplace
Downloads
34
Maintainers
Readme
@gamevault/sdk
GameVault SDK - Unified API for game asset marketplace. Works in Node.js, Deno, Bun, and browsers.
Installation
npm
npm install @gamevault/sdkJSR (Deno)
deno add jsr:@gamevault/sdkDocumentation
Full documentation at: https://gamevault.com/docs
Features
- Asset Management — Search, download, and manage game assets
- Authentication — OAuth device code flow for user authentication
- Generation — AI-powered asset generation (sprites, animations, creatures)
- Bundles — Read/write
.gasbundle format for cross-engine asset sharing - Runtime — Universal runtime loader for game engines
Usage
import { createSDK, GameVaultSDK } from "@gamevault/sdk";
// Create SDK instance
const sdk = createSDK({
serverUrl: "https://gamevault.com",
apiKey: process.env.GAMEVAULT_API_KEY,
});
// Search assets
const assets = await sdk.assets.search({
query: "explosion sprite",
type: "sprite",
limit: 10,
});
// Download asset
const bundle = await sdk.assets.download(assetId);
// Load bundle in your engine
import { RuntimeLoader } from "@gamevault/sdk/runtime";
const loader = new RuntimeLoader(engine);
await loader.loadBundle(bundle);API Overview
createSDK(config)
Creates an SDK instance with the provided configuration.
const sdk = createSDK({
serverUrl: "https://gamevault.com",
apiKey: "your-api-key",
timeout: 30000,
});Services
| Service | Description |
|---------|-------------|
| sdk.assets | Search, browse, download assets |
| sdk.store | Store management and settings |
| sdk.users | User profile and preferences |
| sdk.projects | Project management |
| sdk.generation | AI asset generation |
| sdk.auth | Authentication utilities |
Bundle Format
The SDK supports the universal .gas bundle format:
import { GasBundle } from "@gamevault/sdk/bundle";
// Read a .gas bundle
const bundle = await GasBundle.read("./asset.gas");
// Access sprite data
const sprite = bundle.getSprite("idle");
console.log(sprite.width, sprite.height);
// Write a modified bundle
await bundle.write("./modified.gas");Development
npm run build # TypeScript compilation
npm run test # Run tests
npm run lint # Lint codeLicense
MIT
