Just a fun little project. Probably not going to work on it much.
Open an issue if a bug is discovered.
$ npm install github:Russell2259/codehs-db
A simple example
import CodeHS_DB from 'codehs-db';
const DB = await CodeHS_DB.init('codehsdb' /*subdomain.codehs.me*/, 'new_database' /*The name of your database. Acts sort of like a file or a folder. If you are using a more common instance do not anticipate security*/);
DB.on('ready', async () => {
// The tokens have been obtained
DB.set('value'); // Set the value of the database
console.log(await DB.get()); // Returns a promise with the value of the database
});
- Create an account with codehs https://codehs.com/signup/begin
- Go to your sandbox https://codehs.com/sandbox
- From there click create program
- Select firebase (or html)
- Setup a server and complete the integration as show above
- Change the subdomain parameter in the config to your project's subdomain name
- You're done!