splynx-api
v0.0.5
Published
The Splynx API Package is Designed to Handle API Calls and Authentication to the Splynx Client Dashboard
Downloads
1
Readme
Splynx API
The Splynx API Package is Designed to Handle API Calls and Authentication to the Splynx Client Dashboard
Installation
npm install @nytely/splynx-api
Usage/Examples
Authentication
Before making any API calls, you need to set up an authentication provider. Choose between Basic_Auth_Provider
or Signature_Auth_Provider
based on your security requirements.
Basic Authentication
import { Basic_Auth_Provider, API_Client } from "@nytely/splynx-api";
const apiKey = "your-api-key";
const apiSecret = "your-api-secret";
const authProvider = new Basic_Auth_Provider(apiKey, apiSecret);
const options = { Host: "https://your-splynx-instance.com" };
const splynxClient = new API_Client(authProvider, options);
Signature Authentication
import { Signature_Auth_Provider, API_Client } from "@nytely/splynx-api";
const apiKey = "your-api-key";
const apiSecret = "your-api-secret";
const authProvider = new Signature_Auth_Provider(apiKey, apiSecret);
const options = { Host: "https://your-splynx-instance.com" };
const splynxClient = new API_Client(authProvider, options);
Making API Calls
Lets use the List()
Method under API_Client.Tariffs.Internet
, which retrieves a list of Internet tariffs as an Example.
//Get the List of Internet Tariffs
const internetTariffs = await splynxClient.Tariffs.Internet.List();
//Log the List of Internet Tariffs to the Console
console.log("Internet Tariffs:", internetTariffs);
Authors
Support
For any support, questions, or discussions related to the Poised project, feel free to join our Discord community:
Contributing
Contributions are always welcome!
You only need to Fork the Project, make the Desired Changes and Submit a Pull Request.