Skip to content
VeguiDev edited this page Sep 28, 2022 · 9 revisions

Welcome to the documentation for the spiget node.js integration library.

Getting Started

Index:

Basic

This library has a main class called SpigetAPI, this class has all the necessary methods to interact with the API.

Installing

Run this line in your terminal to install this package in your NPM project.

npm i spiget-api

Usage

Import 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>

Example

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); 

Clone this wiki locally