Shared Assets API
Download host-provisioned asset bundles that are shared across titles or reused within your game. Shared assets reduce bundle size and keep large media up to date without shipping updates.
Quick Start
import RundotGameAPI from '@series-inc/rundot-game-sdk/api'
const bundleBuffer = await RundotGameAPI.sharedAssets.loadAssetsBundle(
'burger-time',
'characters',
)
console.log('Bundle bytes:', bundleBuffer.byteLength)API Reference
loadAssetsBundle(game: string, bundleKey: string, fileType?: string): Promise<ArrayBuffer>
Resolves with raw bundle bytes (ArrayBuffer). Hand them to your own decompressor, asset loader, etc.
game
string
Yes
-
The CDN namespace for the bundle (typically the game that owns the assets). Only used to build the CDN fallback URL; see the hint below.
bundleKey
string
Yes
-
Identifies the bundle. On the RPC path this is the only field the host uses to resolve the asset; it is also the filename stem in the CDN fallback URL.
fileType
string
No
'stow'
File extension used when building the CDN fallback URL ({game}/{bundleKey}.{fileType}).
Host implementations attempt to load via RPC first and fall back to the CDN when the RPC lookup fails. Keep CDN and embedded assets in sync.
Base64 Helpers
loadAssetsBundle already hands you an ArrayBuffer, but if you receive raw base64 asset data yourself (for example a base64 payload from another host message or a text manifest), the SDK ships two decoding helpers. They are plain function exports, not methods on the sharedAssets namespace, so import them directly:
base64ToArrayBuffer(base64: string): ArrayBuffer
Decodes a base64 string into an ArrayBuffer using native atob(). Use it for binary assets (images, audio, packed bundles).
base64ToUtf8(base64: string): string
Decodes a base64 string into a UTF-8 string. Use it for text-based shared assets (JSON manifests, ink scripts). It tries TextDecoder first, then Buffer, then a legacy atob / decodeURIComponent fallback, so it works across runtimes.
Third-Party Developer Use Case
Shared assets enable cross-game asset sharing. For example, a first-party game can upload assets that third-party developers can use in their own games:
This pattern allows:
First-party games to publish reusable assets
Third-party developers to incorporate those assets
Consistent character/asset appearance across games
Reduced bundle sizes for all games using shared assets
Available Bundles
Currently available shared asset bundles:
burger-time
characters
Character sprites and animations
burger-time
burgershop
Core game assets
burger-time
vfx
Visual effects assets
Best Practices
Use the embedded bundles to reduce on-demand loading, speeding up app start.
Cache loaded bundles locally if you'll need them multiple times.
Handle loading failures gracefully: fall back to placeholder assets if needed.
Keep CDN and embedded assets in sync for consistent behavior.
Last updated