🚢
Airship
  • Getting Started
    • Welcome to Airship
    • Installing Airship
  • TypeScript
    • Overview
    • AirshipBehaviour
      • Adding Inspector Properties
      • AirshipSingleton
      • Using Component Decorators
      • Accessing Other Components
  • Publishing
    • Publish Game
    • Developer Console
  • Networking
    • Multiplayer
    • Local Server Mode
    • Network Signals
    • Network Functions
    • Network Identity
    • Network Transform
  • Input
    • User Input
      • Actions
      • Keyboard
      • Mouse
    • Proximity Prompts
  • Core Package
    • What is the Core Package?
    • Chat Commands
    • Inventory
    • Spawning Characters
    • Enable / Disable Core Features
  • Physics
    • Physics Settings
    • Physics Layers
  • Platform Services
    • Data Store
      • Locking
    • Cache Store
    • Leaderboards
    • Platform Inventory
    • Server Management
    • Server List
    • Server Transfers
    • Users
    • Parties
    • Matchmaking
    • External Services
  • CHARACTERS
    • Quick Configuration
    • Character Movement System
      • Character Movement Data
      • Character Movement Events
    • Character Camera
      • First Person Camera
      • Simple Usage
      • Camera Structure
      • Default Camera Modes
      • Disabling the Camera System
    • Character Animations
      • Character Blender Animations
      • Character Ragdoll
  • Accessories
    • Accessories Intro
    • Creating Accessories
    • Using Accessories
  • ANIMATIONS
    • Animation Events
  • Optimization
    • Live Game Profiler
    • Reducing Bundle Size
  • Game Settings
    • Game Visibility
  • Other
    • Project Status
    • FAQ
    • DataType Math
    • JS to Luau
    • Tags
    • Terrain
    • AirshipNetworkBehaviour
      • Lifecycle Events
      • ServerRpc
      • ObserversRpc
      • TargetRpc
    • VoxelWorld
      • Voxel World Getting Started
      • Voxel World Tips
      • Prefab Voxels
      • QuarterBlocks
    • Easy Helper Utils
      • Easy Motion
      • Easy Grid Align
      • Easy Look At
      • Easy Shake
      • Easy Destroy
Powered by GitBook
On this page
  1. Platform Services

Data Store

PreviousPhysics LayersNextLocking

Last updated 5 months ago

The Data Store provides simple key/value persistent storage. The Data Store API can be accessed using Platform.Server.DataStore.

  • Data Store is durable. Data saved will not be deleted or cleaned up.

  • The Data Store API can only be used on the server.

  • Data Store is slower than Cache Store.

Some common use cases for the Data Store are:

  • User Profiles

  • Tracking Unlocks

  • Persistent Inventory

Data Store is intended to be used for general purpose persistent key/value storage. Check out , , and for more specialized data storage situations.

Data store keys must be alphanumeric and only contain allowed symbols: -, ., _, :

Common Patterns

// Store user unlocks
const unlocks: UnlockData = {
    level1: true,
    level2: true,
    level3: false,
}
await Platform.Server.DataStore.SetKey(`Unlocks:${player.userId}`, unlocks);

// Get user unlocks
const result = await Platform.Server.DataStore.GetKey<UnlockData>(
    `Unlocks:${player.userId}`,
);
if (!result.success) return;

// Check if user has unlocked level2
if (result.data.level2) {
    // Unlocked!
}
Cache Store
Leaderboards
Platform Inventory