Skip to content

useThirstie composable

The library contains a vuejs composable function, useThirstie which uses the ThirstieClient library to manage Thirstie API interactions, e-commerce user state, and local storage in order to controll all aspects of the e-commerce session.

Session state is managed by Thirstie's backend and the useThirstie composable manages session tokens to ensure a consistent user experience -- for example persisting a session if the user closes and reopens the browser tab.

The useThirstie composable also manages branding configuration settings, so that components can use the appropriate brand colors, logo, etc.

You generally won't need to interact with useThirstie directly. It is initialized by initApp with your site configuration.

useThirstie()

Parameters

No parameters

Returns
Objecttypedescription
thirstieClientobjectThirstieClient instance
brandStyleobjectTheme values, e.g. primary & secondary colors, logo, etc.
stripeGatewayobjectStripe.js object for payments
routesobjectCustom routes (optional)
brandContentobjectSupport email, other custom global content
setLocalStorageSessionStatemethodUsed by components to set local storage