npm.io
0.5.7 • Published 3 years ago

@teamtito/checkout-client

Licence
Version
0.5.7
Deps
2
Size
30 kB
Vulns
25
Weekly
0

Tito Checkout API JavaScript Client

Usage:

Import as an ES module

import Tito from "@teamtito/checkout-client/dist/client.esm"

Get an Event

const event = await Tito.TitoEvent.get("ultimateconf/2013");

Create a Registration

const registration = await Tito.Registration.create({event: "ultimateconf/2013", line_items: {...}})

Update Registration

const updated = await registration.update({
  name: "Indiana Jones",
  email: "ijones@barnett.edu"
});

Update a Ticket

const updated = await ticket.update({
  first_name: "Henry",
  last_name: "Jones",
  email: "hjones@cairo.ac.uk"
});

Getting started

Clone this repository and install its dependencies:

git clone https://github.com/rollup/rollup-starter-lib
cd rollup-starter-lib
npm install

npm run build builds the library to dist, generating three files:

  • dist/client.cjs.js A CommonJS bundle, suitable for use in Node.js, that requires the external dependency. This corresponds to the "main" field in package.json
  • dist/client.esm.js an ES module bundle, suitable for use in other people's libraries and applications, that imports the external dependency. This corresponds to the "module" field in package.json
  • dist/client.umd.js a UMD build, suitable for use in any environment (including the browser, as a <script> tag), that includes the external dependency. This corresponds to the "browser" field in package.json

npm run dev builds the library, then keeps rebuilding it whenever the source files change using rollup-watch.

npm test builds the library, then tests it.

License

MIT.