Skip to content

Global Config

Reference for settings passed to haven.init() and haven.config().

haven.init() settings

Used when loading Haven standalone (not via Kit).

OptionTypeDefaultDescription
havenDomainstringhttps://havenapi.havendestinations.ca/API base URL (trailing slash required)
havenVersionnumber1API version segment (api/v{N}/)
havenFeedIdstring''API key sent as haven-key header
havenParentFeedIdstring''Alternate feed ID for parent-feed products
defaultSelectorstring#haven-appDefault DOM render target
imgixDomainstringhttps://havenapi.imgix.net/Image CDN base URL
mapboxApiKeystring''Mapbox access token
googleMapsApiKeystring''Reserved for future use
useFontAwesomebooleanauto-detectedEnable Font Awesome icons
useMapBoxbooleanauto-detectedEnable Mapbox maps
templatePathstring''Custom template base URL
userTemplatesarray[]Template filenames to override
breakpointsobjectsee belowResponsive breakpoint values

Default breakpoints

javascript
{
  mobile: 480,
  tablet: 800,
  desktop: 1024,
  'desktop-large': 1200,
  'desktop-xlarge': 1360,
}

haven.config() settings

Passed to haven.config() before rendering a module. Only these keys are processed by config():

OptionTypeDescription
templatePathstringBase URL for custom templates (trailing slash added automatically)
userTemplatesarrayTemplate filenames to load from templatePath
useFontAwesomebooleanEnable or disable Font Awesome detection
useMapBoxbooleanEnable or disable Mapbox detection
breakpointsobjectResponsive breakpoints (injects CSS custom properties)

haven facade methods

MethodReturnsDescription
haven.init(settings, callback?)havenInitialize library and create haven.fetch
haven.ready()booleantrue after init completes
haven.config(settings)havenSet global options, create plugins
haven.render(options, callback?)Generic render
haven.initUI({ type, format }, callback?)Initialize UI behaviors
haven.setTemplatePath(path)havenOverride template base URL
haven.setBreakpoints(breakpoints)Inject breakpoint CSS variables
haven.getFilterValues(type)object|nullRead persisted filter state
haven.setFilterValues(type, value)Save or clear filter state
haven.faves()HavenFavesFavorites helper instance
haven.removeEmptyNode(selector)Remove empty DOM nodes

Plugin accessors

Created by haven.config():

PropertyUsage
haven.directory.init(options, callback?).render()
haven.calendar.init(options, callback?).render()
haven.fetchAPI data methods (available after init())

Routing defaults

See Routing. Defaults from the library:

javascript
{
  path: '/',
  singlePath: '',
  type: '',
  titleSep: ' - ',
  doPathChange: false,
  hashDocument: null,
}

Haven Destinations integration documentation