1.7.0 • Published 2 years ago

@citybrewcoffee/toast-api-wrapper v1.7.0

Weekly downloads
53
License
ISC
Repository
github
Last release
2 years ago

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!

1.7.0

2 years ago

1.6.8

3 years ago

1.6.7

3 years ago

1.6.6

3 years ago

1.6.5

3 years ago

1.6.4

4 years ago

1.6.3

4 years ago

1.6.2

4 years ago

1.6.1

4 years ago

1.6.0

4 years ago

1.5.1

4 years ago

1.5.0

4 years ago

1.4.11

4 years ago

1.4.13

4 years ago

1.4.12

4 years ago

1.4.10

4 years ago

1.4.9

4 years ago

1.4.8

4 years ago

1.4.7

5 years ago

1.4.6

5 years ago

1.4.5

5 years ago

1.4.4

5 years ago

1.4.3

5 years ago

1.4.2

5 years ago

1.4.1

5 years ago

1.4.0

5 years ago

1.3.10

5 years ago

1.3.9

5 years ago