1.0.0 • Published 1 year ago

open-cloud.js v1.0.0

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

About

open-cloud.js is a wrapper around Roblox's Open Cloud API.

Example

import { Client } from "open-cloud.js";

const client = new Client({
    apiKey: "",
    universeId: ""
});

(async () => {
    const dataStoreInstance = client.DataStore.createInstance("Cash");

    // Give "Roblox" 750 cash
    console.log(
        await dataStoreInstance.setEntry({
            entryKey: "1",
            content: "750"
        })
    );
    /*
    Respond:
    {
        version: '', // The entry version
        deleted: false, // Is it deleted?
        contentLength: 3, // The number is 3 letter long!
        createdTime: '', // The time when you set the cash amount
        objectCreatedTime: '' // The time when the key was created
    }
    */

    console.log(
        await dataStoreInstance.getEntry({
            entryKey: "1"
        })
    );
    // Oh hey! Roblox still have 750 cash!

    console.log(await dataStoreInstance.listEntries());
    /*
    {
        // Oh hey! only roblox have the cash!
        keys: [ { key: '1' } ],
        nextPageCursor: ''
    }
    */
})();