@v-office/guest-sdk
v1.5.0
Published
Guest-facing SDK facade for the vOffice Guest App API
Downloads
364
Readme
@v-office/guest-sdk
Curated TypeScript SDK for the vOffice Guest App API.
Installation
pnpm add @v-office/guest-sdkUsage
import { createGuestSDK } from "@v-office/guest-sdk";
const guest = createGuestSDK();
const info = await guest.auth.info();
const bookings = await guest.bookings.list();
if (!bookings.ok) {
console.error(bookings.error.message);
} else {
console.log(bookings.data[0]);
}The SDK uses relative URLs internally, so it works when your app is served from the same host as the Guest API.
Methods return { ok: true, data } on success and { ok: false, error } on failure.
Booking modification
const modification = await guest.bookings.getModification({
bookingId: bookings.data[0].id,
locale: "de-DE",
});
if (!modification.ok) {
console.error(modification.error.message);
} else {
const nextResult = await modification.data.setAdditionalServiceQuantity({
serviceId: modification.data.additionalServices[0].id,
quantity: 2,
});
}Generated OpenAPI internals are intentionally not exported. Consumers should use the SDK surface exposed by this package.
