Skip to main content

Library

The SmartCompanion library is the code behind every SmartCompanion app: the data layer, the services that drive it, and the web components visitors see. The audioguide app is a thin shell around it, and so are the venue apps built on it.

This section is for developers — writing an app of their own, routing to pages the default app leaves out, or changing the components themselves. Running a guide with the default app needs none of it; start with the Quickstart instead.

The packages​

PackageWhat it is
@smartcompanion/dataDomain models and the data layer: stations, tours, assets, languages, texts, PINs; storage, loading and updates
@smartcompanion/servicesThe ServiceFacade over the data layer, plus audio playback, the menu and routing
@smartcompanion/uiStencil web components: five building blocks and thirteen ready-made pages

The pages in ui do not import services. Each page declares the slice of the facade it uses as a TypeScript type, and the ServiceFacade of services satisfies all of them — so an app passes one object to every page, and a test can pass a small stand-in.

Versions​

All three packages are released together and always share one version number. They use semver: a major release can break apps built on them, and its changelog says how to migrate.

LibraryIonicRouting
2.x9ion-router rendering into ion-router-outlet
1.x8ion-router driving ion-nav

The changelogs: data · services · ui.

Read on​

PageWhat it covers
Getting startedInstalling the packages and wiring up a minimal app
DataThe models, storage, and how content is loaded and updated
ServicesThe facade, the audio player and the menu
RoutingNavigating between pages with Ionic 9
UI componentsThe pages and components, their texts, and the map
DevelopmentWorking on the library itself
StorybookEvery component, live, with its properties and events