1.0.0 • Published 2 years ago

dineup-clientjs v1.0.0

Weekly downloads
-
License
-
Repository
-
Last release
2 years ago

DineUp Client Library

This library embeds a configurable DineUp order widget into a web page

Installation

Install the package with:

npm install dineup-clientjs --save

Usage

Use this package as an ES Module

import { DineUp } from "dineup-clientjs";

const options = {
  live_mode: false,
  element: "dineup-order-element",
};
const dineup = new DineUp(options);

dineup.init("<client_secret>", (order) => {
  console.log(order);
});

then in your html

<div id="dineup-order-element"></div>

Typescript

This package includes TypeScript types

Documentation

constructor(options: CreateOptions)

CreateOptions {
  live_mode?: boolean; // Set this to true in production

  element: string | HTMLElement;
}

init(client_secret: string, callback: (order: ClientOrder) => void)

Types

ClientOrder {
  line_items: ClientLineItem[];
}

ClientLineItem {
  amount: number;
  image_url: string;
  name: string;
  quantity: number;
}
1.0.0

2 years ago

0.0.13

2 years ago

0.0.12

2 years ago

0.0.11

2 years ago

0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago