   _.reduce initParams, (config, param, key)->
     return unless config
     value = getParamValue(hull_js_sdk, param, key)
-    if value
+    if value?
       config[key] = value
     else if param.required
       config = false

getParamValue = (el, param, key)->
  keys = [key].concat(param.altKeys || [])
  transform = param.transform || (o)-> o
  _.reduce(keys, (ret, k)->
    if !ret
      value = transform(el.getAttribute(dasherize(k)) || el.getAttribute(k) || el.dataset[k])
      valid = value? && (!param.validation  || param.validation(value, k))
      ret = value if valid
    ret
  , null) || param.default


module.exports = ->


transform =

  url: (url, key)->
    if url && url.length > 0
      a = document.createElement('a')
      a.href = url
      a.href

  bool: (str, key)->
    switch str
      when 'true', true then true
      when 'false', false then false
      else undefined

initParams = {
  appId: {
