Use this sdk to :
- Make API calls to your specific API (API Platform)
- Interact with standard AppsPanel modules (User/Auth, File & Content Management) -- coming soon
- Send specific KPI (Analytics) -- coming soon
NodeJS-SDK will work on most systems out-of-the-box with nodejs and native API (no dependencies required).
npm install apnl
Build ap-config.json :
{
"appname": "YOURAPPNAME",
"appkey": "YOURAPPKEY",
"log_level": 1
}
- appname : this is your appname (you get it when you create an app on backend.appspanel.com)
- appkey : this is your appkey (you get it when you create an app on backend.appspanel.com)
- log_level :
- 0 : no log
- 1 : error => what you want in production
- 2 : error & info => what you want in development
- 3 : error, info & debug
var apnl = require('apnl')();
if configuration is named "ap-config.json" and exists in the current directory.
or
var apnl = require('apnl')('../ap-config.json');
depending on where your config is located and how it is named.
Make your first call :
var apnl = require('apnl')();
//very simple GET request on /test with get parameters foo (value FOO), and callback success and error provided
apnl.request("test?foo=FOO", null, function (data) {
//success
console.log("callback success");
console.log(data);
}, function (error) {
//error
console.log("callback error");
console.log(error);
});
Get more examples here
Feel free to contact us on : support@apps-panel.com