Build powerful systems integrating your services together like never before.
import Stacket from "stacket";
//OR
const Stacket = require("stacket").default;
const client = new Stacket("auth-token");
client.verify().then(() => {
console.log("Authenticated with Stacket");
}).catch(console.error);
client.createService({
"type": "minecraft",
"node": "fsn10",
"package": "pkg1",
"platform": "spigot",
"version": "1.8.8"
}).then(service => {
console.log(service);
}).catch(console.error);
let serviceId = "5ef951de74eb7027994b585b";
client.getService(serviceId).then(service => {
service.setName("New service name!");
}).catch(console.error);
let serviceId = "5ef951de74eb7027994b585b";
client.getService(serviceId).then(service => {
service.delete();
}).catch(console.error);
client.createNetwork({
"name": "Test Network",
"type": "ipv6"
}).then(network => {
console.log(network);
}).catch(console.error);
let networkId = "5ea5d1f9c2c50957ceae7dfb";
client.getNetwork(networkId).then(network => {
network.setName("New network name!");
}).catch(console.error);
let networkId = "5ea5d1f9c2c50957ceae7dfb";
client.getNetwork(networkId).then(network => {
network.delete();
}).catch(console.error);
client.createDrive({
"name": "Test Drive",
"size": 250 // Specified in GB
}).then(drive => {
console.log(drive);
}).catch(console.error);
let driveId = "5ef5f7e771cdd7625a303da6";
client.getDrive(driveId).then(drive => {
drive.setName("New drive name!");
}).catch(console.error);
let driveId = "5ef5f7e771cdd7625a303da6";
client.getDrive(driveId).then(drive => {
drive.setSize(500);
}).catch(console.error);
let driveId = "5ef5f7e771cdd7625a303da6";
client.getDrive(driveId).then(drive => {
drive.delete();
}).catch(console.error);
client.createFolder({
"name": "Test Folder",
"disks": [],
"networks": [],
"services": ["5ef951de74eb7027994b585b"]
});
let folderId = "5f177a83e355067a6dfa037a";
client.getFolder(folderId).then(folder => {
folder.setName("New folder name!");
}).catch(console.error);
let folderId = "5f177a83e355067a6dfa037a";
client.getFolder(folderId).then(folder => {
folder.addItem({"id": "5ef951de74eb7027994b585b", "type": "service"});
}).catch(console.error);
let folderId = "5f177a83e355067a6dfa037a";
client.getFolder(folderId).then(folder => {
folder.removeItem({"id": "5ef951de74eb7027994b585b", "type": "service"});
}).catch(console.error);
let folderId = "5f177a83e355067a6dfa037a";
client.getFolder(folderId).then(folder => {
folder.delete();
}).catch(console.error);