@livepreso/api
v6.48.1
Published
Everything to do with talking to the SalePreso API
Downloads
33
Readme
API
The single point of entry for interacting with the SalesPreso API. Contains functionality for contacting and authorizing wi the API endpoint, as well as middleware, models and collections for sending and retrieving data.
Install
npm install sp-api
or
yarn add sp-api
Examples
import {Auth, Api} from "@livepreso/api";
import {registerMiddleware} from "@livepreso/api/middleware";
import AuthMiddleware from "@livepreso/api/middlewares/auth";
import RedirectMiddleware from "@livepreso/api/middlewares/redirect";
const middlewares = [
new AuthMiddleware(),
new RedirectMiddleware(),
new JSONMiddleware()
];
middlewares.map(registerMiddleware);
Api.initialize("http://localhost:8000/api/")
.then(() => {
return Auth.login("yourlogin", "yourpassword");
});
Documentation
http://developers.salespreso.com/modules/sp-api/