Overview
@jetronticket/api, a typed zero-dependency client for Jetron Fluid.
@jetronticket/api is the official TypeScript client for Jetron Fluid. It
wraps the REST endpoints as typed functions using the platform fetch, so it
runs in browsers and Node.js 18+ with no dependencies. It ships ESM and
CJS builds with full type declarations, and mirrors the
OpenAPI spec exactly.
Install
npm install @jetronticket/apiQuick start
import { createClient } from '@jetronticket/api'
const client = createClient({
apiKey: 'jt_public_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
})
// Browse events (data is unwrapped from the response envelope)
const { data: events } = await client.listEvents({ limit: 20, q: 'jazz' })
// Checkout flow
const { data: reservation } = await client.createReservation('my-event', {
items: [{ sku: 'ticket-type-uuid', quantity: 2 }],
})
const { data: order } = await client.createOrder(
'my-event',
{
quoteReference: reservation.quoteReference,
email: 'attendee@example.com',
firstName: 'Kendall',
lastName: 'Roy',
callbackUrl: 'https://your-site/checkout/callback',
},
{ deviceId: reservation.reservationToken }, // echoed as X-Device-ID
)
if (order.status === 'pending_payment') {
window.location.href = order.checkoutUrl // redirect to the payment gateway
}
