This is a playground
to test code. It runs a full Node.js
environment and already has all of npm
’s 1,000,000+ packages pre-installed, including tinyburg
with all npm
packages installed. Try it out:
/**
* Mock application using the tinyburg lib, checks
* if you are entered in the next raffle drawing
*/
const tinyburg = require("tinyburg");
const defaultConfig = require("tinyburg/dist/tt-config").defaultConfig;
// Replace these with your player id and your player ss.
// If you don't know your player ss, you can get it by
// authenticating. The authentication docs can be found
// on github. You can use either the authentication example
// from the examples folder or the CLI app to authentication.
// If you don't want to do through the hassle of downloading
// the CLI app, you can use the hosted REPL from the readme.
const yourPlayerId = "<Your PlayerID Here>";
const yourPlayerSs = "<xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx>";
const player = { playerId: yourPlayerId, playerSs: yourPlayerSs, playerEmail: "" };
// Import the library and create an object
// These comments are for the linters, they do nothing on RunKit
const tinyTower = tinyburg.fromConfig({ ...defaultConfig, player });
// Check if you are entered in the current raffle drawing
tinyTower
.checkEnteredRaffle()
.then((entered) => console.log(`You are ${entered ? "entered" : "not entered"} in the current raffle drawing`))
.catch((error) => console.error(error));
This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.