@livepreso/api
v6.57.0
Published
Everything to do with talking to the SalePreso API
Keywords
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-apior
yarn add sp-apiExamples
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/
