Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rblx.js

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rblx.js

A JavaScript wrapper for interacting with the ROBLOX OpenCloud API.

  • 1.0.71
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source
A JavaScript wrapper for the ROBLOX OpenCloud API.

Introduction

Recently at RDC 2022, ROBLOX announced OpenCloud API endpoints for DataStore, MessagingService and more. These would have official libraries for languages such as Python and JavaScript eventually, but until then, roblox.js bridges this gap as an API wrapper.

Installation

Yarn:

yarn add rblx.js

NPM:

npm i rblx.js

Usage

Roblox.js is a OpenCloud API wrapper with full TypeScript support. Once installed, you can access the following classes:

  • Datastore
  • MessagingService

Functions are named similar to the Lua equivalents and follow a similar structure. Each class is initialized with a universeId and an apiKey from https://create.roblox.com/credentials.

Datastore

GetAsync

GetAsync lets you fetch the value of a particular Key in a datastore.

const { Datastore } = require('rblx.js')

const datastore = new Datastore("UNIVERSE_ID", "API_KEY")

await datastore.GetAsync("DATASTORE_NAME", "KEY_NAME")

Returns: Promise<string|number|boolean|undefined>

SetAsync

SetAsync lets you set the value of a particular Key in a datastore.

const { Datastore } = require('rblx.js')

const datastore = new Datastore("UNIVERSE_ID", "API_KEY")

await datastore.SetAsync("DATASTORE_NAME", "KEY_NAME", "VALUE")

Optional Arguments: matchVersion: string, exclusiveCreate: Boolean
Returns: Promise<DatastoreSetResponse|undefined>

RemoveAsync

RemoveAsync lets you remove a key from a datastore.

const { Datastore } = require('rblx.js')

const datastore = new Datastore("UNIVERSE_ID", "API_KEY")

await datastore.RemoveAsync("DATASTORE_NAME", "KEY_NAME")

Returns: Promise<undefined>

ListKeysAsync

ListKeysAsync lets you fetch a list of keys in a datastore.

const { Datastore } = require('rblx.js')

const datastore = new Datastore("UNIVERSE_ID", "API_KEY")

await datastore.ListKeysAsync("DATASTORE_NAME")

Returns: Promise<DatastoreSetResponse|undefined>

ListDataStoresAsync

ListDataStoresAsync lets you fetch a list of datastores in a universe.

const { Datastore } = require('rblx.js')

const datastore = new Datastore("UNIVERSE_ID", "API_KEY")

await datastore.ListDataStoresAsync()

Optional Arguments: prefix: string, limit: string, cursor: string, AllScopes: boolean
Returns: Promise<DatastoreEntries|undefined>

GetVersionAsync

GetVersionAsync lets you fetch a key from its version.

const { Datastore } = require('rblx.js')

const datastore = new Datastore("UNIVERSE_ID", "API_KEY")

await datastore.GetVersionAsync("DATASTORE_NAME", "KEY_NAME", "08DA9790C75527F0.0000000011.08DA9798C9BEB578.01")

Optional Arguments: scope: string
Returns: Promise<string|number|boolean|undefined>

IncrementAsync

IncrementAsync increments a key with an integer value by the given value.

const { Datastore } = require('rblx.js')

const datastore = new Datastore("UNIVERSE_ID", "API_KEY")

await datastore.IncrementAsync("DATASTORE_NAME", "KEY_NAME", 3)

Returns: Promise<DatastoreSetResponse>

License

MIT © DevComp - see the LICENSE.md file for details.

FAQs

Package last updated on 23 Sep 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc