@livepreso/api

6.46.0 • Public • Published

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/

Readme

Keywords

none

Package Sidebar

Install

npm i @livepreso/api

Weekly Downloads

1

Version

6.46.0

License

UNLICENSED

Unpacked Size

1.97 MB

Total Files

525

Last publish

Collaborators

  • ahoddinott
  • bennullgraham
  • zephri