-
Notifications
You must be signed in to change notification settings - Fork 0
Datastore
Compey edited this page Jan 19, 2023
·
2 revisions

A JavaScript wrapper for the ROBLOX OpenCloud API.
GetAsync lets you fetch the value of a particular Key in a datastore.
const { Datastore, ClientIntents } = require('rblx.js')
const datastore = new Datastore({
apiKey: "API_KEY",
universeId: "UNIVERSE_ID",
intents: [ "datastore" ]
})
await datastore.GetAsync("DATASTORE_NAME", "KEY_NAME")import { Datastore, ClientIntents } from 'rblx.js'
const datastore = new Datastore({
apiKey: "API_KEY",
universeId: "UNIVERSE_ID",
intents: ClientIntents.Datastore
})
await datastore.GetAsync("DATASTORE_NAME", "KEY_NAME")SetAsync lets you set the value of a particular Key in a datastore.
const { Datastore, ClientIntents } = require('rblx.js')
const datastore = new Datastore({
apiKey: "API_KEY",
universeId: "UNIVERSE_ID",
intents: [ "datastore" ]
})
await datastore.SetAsync("DATASTORE_NAME", "KEY_NAME", "VALUE")import { Datastore, ClientIntents } from 'rblx.js'
const datastore = new Datastore({
apiKey: "API_KEY",
universeId: "UNIVERSE_ID",
intents: ClientIntents.Datastore
})
await datastore.SetAsync("DATASTORE_NAME", "KEY_NAME", "VALUE")RemoveAsync lets you remove a key from a datastore.
const { Datastore } = require('rblx.js')
const datastore = new Datastore({
apiKey: "API_KEY",
universeId: "UNIVERSE_ID",
intents: [ "datastore" ]
})
await datastore.RemoveAsync("DATASTORE_NAME", "KEY_NAME")import { Datastore, ClientIntents } from 'rblx.js'
const datastore = new Datastore({
apiKey: "API_KEY",
universeId: "UNIVERSE_ID",
intents: ClientIntents.Datastore
})
await datastore.RemoveAsync("DATASTORE_NAME", "KEY_NAME")ListKeysAsync lets you fetch a list of keys in a datastore.
const { Datastore, ClientIntents } = require('rblx.js')
const datastore = new Datastore({
apiKey: "API_KEY",
universeId: "UNIVERSE_ID",
intents: [ "datastore" ]
})
await datastore.ListKeysAsync("DATASTORE_NAME")import { Datastore, ClientIntents } from 'rblx.js'
const datastore = new Datastore({
apiKey: "API_KEY",
universeId: "UNIVERSE_ID",
intents: ClientIntents.Datastore
})
await datastore.ListKeysAsync("DATASTORE_NAME")ListDataStoresAsync lets you fetch a list of datastores in a universe.
const { Datastore, ClientIntents } = require('rblx.js')
const datastore = new Datastore({
apiKey: "API_KEY",
universeId: "UNIVERSE_ID",
intents: [ "datastore" ]
})
await datastore.ListDataStoresAsync()import { Datastore, ClientIntents } from 'rblx.js'
const datastore = new Datastore({
apiKey: "API_KEY",
universeId: "UNIVERSE_ID",
intents: ClientIntents.Datastore
})
await datastore.ListDataStoresAsync()GetVersionAsync lets you fetch a key from its version.
const { Datastore, ClientIntents } = require('rblx.js')
const datastore = new Datastore({
apiKey: "API_KEY",
universeId: "UNIVERSE_ID",
intents: [ "datastore" ]
})
await datastore.GetVersionAsync("DATASTORE_NAME", "KEY_NAME", "08DA9790C75527F0.0000000011.08DA9798C9BEB578.01")import { Datastore, ClientIntents } from 'rblx.js'
const datastore = new Datastore({
apiKey: "API_KEY",
universeId: "UNIVERSE_ID",
intents: ClientIntents.Datastore
})
await datastore.GetVersionAsync("DATASTORE_NAME", "KEY_NAME", "08DA9790C75527F0.0000000011.08DA9798C9BEB578.01")IncrementAsync increments a key with an integer value by the given value.
const { Datastore, ClientIntents } = require('rblx.js')
const datastore = new Datastore({
apiKey: "API_KEY",
universeId: "UNIVERSE_ID",
intents: [ "datastore" ]
})
await datastore.IncrementAsync("DATASTORE_NAME", "KEY_NAME", 3)import { Datastore, ClientIntents } from 'rblx.js'
const datastore = new Datastore({
apiKey: "API_KEY",
universeId: "UNIVERSE_ID",
intents: ClientIntents.Datastore
})
await datastore.IncrementAsync("DATASTORE_NAME", "KEY_NAME", 3)MIT © DevComp - see the LICENSE.md file for details.