Code Monkey home page Code Monkey logo

noblox.js's Introduction

noblox.js

A Node.js wrapper for interacting with the Roblox API. Forked from roblox-js.

JavaScript Style Guide noblox.js Discord NPM package Travis Build Status

AboutPrerequisitesInstallationDocsExamplesYouTube SeriesCreditsLicense

About

Noblox.js is a node module that was forked from sentanos's roblox-js module. This project was created because the roblox-js repository was no longer maintained by sentanos.

Noblox.js allows you to do things you would normally do on the Roblox website through a Node.js interface. You can use noblox.js along with Roblox's HttpService feature to create scripts that interact with the website. If you're looking for more information on how to create something like this, check out this repository by sentanos. Keep in mind that this does not use the latest version of this module and it is highly encouraged that you learn to use the library directly.

Prerequisites

Installation

With node.js installed simply run:

# Run this to install noblox.js locally to your repository. 
$ npm install noblox.js --save

# if you're using yarn:
$ yarn add noblox.js

# Run this instead to install noblox.js globally so you can use it anywhere.
$ npm install noblox.js -g

That's it!

Documentation

You can find the current noblox.js wiki with all API documentation here. Keep in mind that all methods may not be documented.

Making use of new login workaround

Note, as of v4.6.0 The way you log in to Noblox has changed significantly. The library is no longer responsible for refreshing your cookies

This is because of many reasons including that creating a file caused several security/usability issues and made the library incompatible with some hosts.

Initial setup

  1. Remove any usages of the login or cookieLogin methods.
  2. Run setCookie with your cookie. This will store your cookie internally and validate it

Note: By default, setCookie will validate the cookie you provide by making a HTTP request. To Disable this behaviour, pass false as the second parameter (validate)

Getting your cookie (Chrome):

  1. Open any Roblox page and login
  2. Press Control + Shift + i on your keyboard
  3. Click Application
  4. Find .ROBLOSECURITY. Copy its contents, which will start with: _|WARNING:-DO
  5. Put this full token, including the warning into setCookie: rbx.setCookie( tokenHere )

Example

This example makes use of the new async-await syntax.

const rbx = require("noblox.js")
async function startApp () {
    await rbx.setCookie("_|WARNING:-DO-NOT-SHARE-THIS.--Sharing-this-will-allow-someone-to-log-in-as-you-and-to-steal-your-ROBUX-and-items.|_F9F1EA531adk")
    // Do everything else, calling functions and the like.
    let currentUser = await rbx.getCurrentUser()
}

Drawbacks

Common issues

CSRF

In July 2020 Roblox updated the endpoint we used to get CSRF tokens (auth.roblox.com/v1/logout) and essentially disabled it. They didn't warn anyone of this change so as of v4.6.3 we've updated to a new endpoint that works. To make use of the new fix, run npm install [email protected]. Alternatively, use latest to get the latest version.

Cookie expiration

We previously advised users to refresh cookies. This is no longer the case. Your Roblox authentication cookies will not expire as long as you do not log into the account, or use the log out or "Sign out all sessions" buttons.

For this reason, we advise you use a bot account.

Credits

  • suufi - Lead maintainer
  • sentanos - We wouldn't exist without him. 😀
  • Neztore - Library maintenance and review
  • popeeyy - Creation of the documentation.
  • edward - Helping with the creation of the documentation.

License

MIT

noblox.js's People

Contributors

sentanos avatar suufi avatar dependabot-preview[bot] avatar neztore avatar eirikfa avatar onlytwentycharacters avatar gamenew09 avatar popeeyy avatar policetonyr avatar alanbixby avatar eragamer avatar hamzah-z avatar unix-system avatar ttury avatar o-y avatar amauryeen avatar chrisvanchip avatar amazman avatar chosey98 avatar vilksian avatar lingledev avatar frykher avatar fantasycoder123 avatar billyh-0167 avatar bannergames avatar anthonyfuller avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.