This package has been deprecated

Author message:

further development continued at https://www.npmjs.com/package/@citybrewcoffee/toast-api-wrapper

toast-api-wrapper
TypeScript icon, indicating that this package has built-in type declarations

1.3.9 • Public • Published

Toast API Wrapper

Wraps a few Toast REST API endpoints for usage in NodeJS. It was built primarily for internal use at City Brew Coffee (https://citybrew.com), but if you find it useful feel free to contribute.

Features

  • Written fully in Typescript and provides type definitions for all objects
  • Very simple to use - no API clients to create
  • Low overhead - uses node fetch for HTTP requests

Usage

If using typescript:

  1. Import the functions and objects you wish to use. Example:

import { getOrders, requestNewToken, getOrderDetails, Check, Selection } from 'toast-api-wrapper';

  1. To generate a token, use the 'requestNewToken' function. Remember: never store your client secret in sourcecode!

  2. For every function, the first paramter is a FunctionParameters object. This wraps the hostname, access token, and restaurant guid together and can be reused in multiple calls.

  3. Every function returns a promise with the function's payload. Chain with .then((result) => /* do stuff */) or use async/await.

  4. Just call functions and use their results. It's that easy!

Readme

Keywords

none

Package Sidebar

Install

npm i toast-api-wrapper

Weekly Downloads

2

Version

1.3.9

License

ISC

Unpacked Size

137 kB

Total Files

57

Last publish

Collaborators

  • mtwichel