-
Notifications
You must be signed in to change notification settings - Fork 1
Home
VeguiDev edited this page Sep 28, 2022
·
9 revisions
Welcome to the documentation for the spiget node.js integration library.
Index:
This library has a main class called SpigetAPI, this class has all the necessary methods to interact with the API.
Run this line in your terminal to install this package in your NPM project.
npm i spiget-apiImport and instance the main class.
import SpigetAPI from 'spiget-api';
const api = new SpigetAPI("example_agent");Or if you using in browser
<script src="https://unpkg.org/spiget-api@latest/dist/spiget-api.umd.min.js"></script>
<script>
let api = new spigetapi("agent_name"); // To instance API Object
</script>import SpigetAPI from 'spiget-api';
// Here we instantiate the main class that has the basic methods to interact with the API.
const api = new SpigetAPI("example agent");
// here we obtain list of resources
let resources = await api.getResources();
console.log(resources);