1.0.0 • Published 1 year ago

dineup-clientjs v1.0.0

Weekly downloads
-
License
-
Repository
-
Last release
1 year 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

1 year ago

0.0.13

1 year ago

0.0.12

1 year ago

0.0.11

1 year ago

0.0.10

1 year ago

0.0.9

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago