Storage API
Choosing a Scope
API
Persists where?
Typical usage
Quick Start
import RundotGameAPI from '@series-inc/rundot-game-sdk/api'
// Device cache (per-device, cross-game)
await RundotGameAPI.deviceCache.setItem('lastUserId', '12345')
const cached = await RundotGameAPI.deviceCache.getItem('lastUserId')
// App storage (per-game)
await RundotGameAPI.appStorage.setItem('playerData', JSON.stringify({ level: 5 }))
// Global storage (per-user, cross-game)
await RundotGameAPI.globalStorage.setItem('preferences', JSON.stringify({ theme: 'dark' }))
// Saves alias (same as appStorage)
await RundotGameAPI.storage.setItem('playerData', JSON.stringify({ level: 10 }))
const snapshot = await RundotGameAPI.storage.getItem('playerData')Batch Helpers
Best Practices
Last updated