1.0.40 • Published 2 years ago

roblox v1.0.40

Weekly downloads
59
License
MIT
Repository
github
Last release
2 years ago

roblox

This module is intended to be used to access the Roblox platform and handle (the best it can) mumbojumbo like X-CSRF-Token headers and throttling/retries.

This package is not published by or supported by Roblox, and is published independently. It may break at any time. Feel free to fork it.

Authentication

Example

import { RobloxHttpClient } from "roblox";

const robloxHttpClient = new RobloxHttpClient({
	// You can put @tix-factory/http HttpClient options here
	// See: https://www.npmjs.com/package/@tix-factory/http
});

const authenticationTicket = "some authentication ticket that came from https://auth.roblox.com/v1/authentication-ticket (POST, RBX-Authentication-Ticket header)";
robloxHttpClient.authenticate(authenticationTicket).then(user => {
	console.log("logged in as", user);
}).catch(err => {
	// Failed to authenticate :(
	console.error(err);
});

Catalog

Example

import { RobloxHttpClient, CatalogClient } from "roblox";

const robloxHttpClient = new RobloxHttpClient({
	// You can put @tix-factory/http HttpClient options here
	// See: https://www.npmjs.com/package/@tix-factory/http
});

const robloxCatalogClient = new RobloxCatalogClient(robloxHttpClient, err => {
	// An error occurred while sending a request through the client.
	// Because the request is retried/batched it's possible this will not affect any awaiting promises.
	// This method exists so the module doesn't completely drop the error into the void.
	// You can expect any individual method call to reject if it maxes out on retries.
	console.warn("An unexpected error occurred while processing catalog request", err);
}, {
	// These are some options that can be overridden, they have defaults if you don't though
	bundleCacheExpiryInMilliseconds: 1000,
	assetCacheExpiryInMilliseconds: 1000,

	// these are wait times before sending requests
	// 15 seconds is high, but I've found it necessary to make sure to avoid 429s
	minProcessDelay: 15 * 1000,
	processDelay: 1000
});

robloxCatalogClient.getAsset(1272714).then(asset => {
	// We loaded an asset!
	console.log(asset);
}).catch(err => {
	// oh no
	console.error(err);
});

Thumbnails

Example

import { RobloxHttpClient, ThumbnailsClient } from "roblox";

const robloxHttpClient = new RobloxHttpClient({
	// You can put @tix-factory/http HttpClient options here
	// See: https://www.npmjs.com/package/@tix-factory/http
});

const thumbnailsClient = new ThumbnailsClient(robloxHttpClient, err => {
	console.warn("An unexpected error occurred while processing thumbnail request", err);
}, {
	// Thumbnails client specific options woooo
});

Users

Example

import { RobloxHttpClient, UsersClient } from "roblox";

const robloxHttpClient = new RobloxHttpClient({
	// You can put @tix-factory/http HttpClient options here
	// See: https://www.npmjs.com/package/@tix-factory/http
});

const usersClient = new UsersClient(robloxHttpClient, err => {
	console.warn("An unexpected error occurred while processing user request", err);
}, {
	// Users client specific options woooo
});

Groups

Example

import { RobloxHttpClient, GroupsClient } from "roblox";

const robloxHttpClient = new RobloxHttpClient({
	// You can put @tix-factory/http HttpClient options here
	// See: https://www.npmjs.com/package/@tix-factory/http
});

const groupsClient = new GroupsClient(robloxHttpClient, err => {
	console.warn("An unexpected error occurred while processing user request", err);
}, {
	// Groups client specific options woooo
});

groupsClient.getGroupById(2518656).then(group => {
	// We loaded a group!
	console.log("Group", group);
}).catch(err => {
	// oh nooooo
});
1.0.40

2 years ago

1.0.38

3 years ago

1.0.36

3 years ago

1.0.34

3 years ago

1.0.32

3 years ago

1.0.30

3 years ago

1.0.28

3 years ago

1.0.26

3 years ago

1.0.24

3 years ago

1.0.22

3 years ago

1.0.20

3 years ago

1.0.18

3 years ago

1.0.16

3 years ago

1.0.14

3 years ago

1.0.11

3 years ago

1.0.9

3 years ago

1.0.7

3 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago

0.0.0

7 years ago