Cloud APIs
StandardDataStoresApi_V1
standardDatastoreEntry

standardDatastoreEntry

Returns the value and metadata associated with an entry. Depending on the runtime, Bun.CryptoHasher or node:crypto is used to calculate the md5 checksum.

Parameters

NameTypeDescription
universeIdIdentifierThe identifier of the experience with data stores that you want to access.
datastoreNamestringThe name of the data store.
entryKeystringThe key identifying the entry.
scope?stringThe value is global by default.

Example

type InventorySchema = { Iron?: number; Gold?: number; Copper?: number; Stone?: number; Wood?: number };
const { data: entryInfo } = await StandardDataStoresApi_V1.standardDatastoreEntry<InventorySchema>({
  universeId: 5097539509,
  datastoreName: "InventoryStore",
  entryKey: "user/45348281",
});
if (!entryInfo.checksumsMatch) console.log("checksums do not match, data may be invalid!");
else console.log("checksums match! ->", entryInfo.entry); 

Example Data

{
  entry: { Gold: 6, Iron: 57 },
  checksumsMatch: true,
  metadata: {
    contentMD5: "hGwoaGwduF4bOhexREYGkA==",
    entryVersion: "08DBB6A47FDE6132.0000000016.08DBB782CEE11766.01",
    entryCreatedTime: 2023-09-16T11:03:03.922Z,
    entryVersionCreatedTime: 2023-09-17T13:34:24.754Z,
    entryAttributes: null,
    entryUserIds: [45348281],
  },
} 

Endpoint

GET /v1/universes/{universeId}/standard-datastores/datastore/entries/entry