Skip to main content

Noughty Tours Web SDK

@thenoughtyfox/noughty-tours-web-sdk ships two things: a typed data client for the Noughty Tours API, and React components that render what it returns.

The client returns plain data and renders nothing, so you can build whatever interface your product needs on top of it. If you would rather not build one, four components cover the common screens.

ComponentScreen
ToursListA browsable list of every tour
TourManagerFloors, rooms and scans, with editing
ViewerThe panorama viewer, including authoring controls
PublicViewerThe read-only viewer for a public tour, addressed by slug

The components read through the same client, so mixing the two is fine — use a component where it fits and drop to the client where it does not.

The client

Every call goes through a NoughtyToursController instance, which exposes four resources:

ResourcePurpose
toursTours, including their floors, rooms and scans
floorsFloor metadata and floor-plan documents
roomsRoom metadata
scansPanorama pose, orientation and thumbnails

Methods return promises that resolve to the parsed response body, or reject with an ApiError. Responses carrying no content resolve to null.

Example apps

A complete working integration, in two halves. Start here if you would rather read working code than reference documentation.

RepositoryWhat it shows
noughty-tours-web-demoA React app wiring up the client and all four components
noughty-tours-web-backend-demoThe backend half — mints tokens and publishes a JWK Set

Next