dineup-clientjs
v1.0.0
Published
This library embeds a configurable DineUp order widget into a web page
Downloads
27
Readme
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;
}