Global Config
Reference for settings passed to haven.init() and haven.config().
haven.init() settings
Used when loading Haven standalone (not via Kit).
| Option | Type | Default | Description |
|---|---|---|---|
havenDomain | string | https://havenapi.havendestinations.ca/ | API base URL (trailing slash required) |
havenVersion | number | 1 | API version segment (api/v{N}/) |
havenFeedId | string | '' | API key sent as haven-key header |
havenParentFeedId | string | '' | Alternate feed ID for parent-feed products |
defaultSelector | string | #haven-app | Default DOM render target |
imgixDomain | string | https://havenapi.imgix.net/ | Image CDN base URL |
mapboxApiKey | string | '' | Mapbox access token |
googleMapsApiKey | string | '' | Reserved for future use |
useFontAwesome | boolean | auto-detected | Enable Font Awesome icons |
useMapBox | boolean | auto-detected | Enable Mapbox maps |
templatePath | string | '' | Custom template base URL |
userTemplates | array | [] | Template filenames to override |
breakpoints | object | see below | Responsive 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():
| Option | Type | Description |
|---|---|---|
templatePath | string | Base URL for custom templates (trailing slash added automatically) |
userTemplates | array | Template filenames to load from templatePath |
useFontAwesome | boolean | Enable or disable Font Awesome detection |
useMapBox | boolean | Enable or disable Mapbox detection |
breakpoints | object | Responsive breakpoints (injects CSS custom properties) |
haven facade methods
| Method | Returns | Description |
|---|---|---|
haven.init(settings, callback?) | haven | Initialize library and create haven.fetch |
haven.ready() | boolean | true after init completes |
haven.config(settings) | haven | Set global options, create plugins |
haven.render(options, callback?) | — | Generic render |
haven.initUI({ type, format }, callback?) | — | Initialize UI behaviors |
haven.setTemplatePath(path) | haven | Override template base URL |
haven.setBreakpoints(breakpoints) | — | Inject breakpoint CSS variables |
haven.getFilterValues(type) | object|null | Read persisted filter state |
haven.setFilterValues(type, value) | — | Save or clear filter state |
haven.faves() | HavenFaves | Favorites helper instance |
haven.removeEmptyNode(selector) | — | Remove empty DOM nodes |
Plugin accessors
Created by haven.config():
| Property | Usage |
|---|---|
haven.directory | .init(options, callback?).render() |
haven.calendar | .init(options, callback?).render() |
haven.fetch | API data methods (available after init()) |
Routing defaults
See Routing. Defaults from the library:
javascript
{
path: '/',
singlePath: '',
type: '',
titleSep: ' - ',
doPathChange: false,
hashDocument: null,
}