     transform: transform.url
     validation: valid.regex(new RegExp("^" + document.location.origin + "/"))
   },
-  debug:   { default: false, transform: transform.bool },
-  verbose: { default: false, transform: transform.bool },
-  embed: { default: true, transform: transform.bool },
-  autoStart: { default: true, transform: transform.bool },
-  accessToken: { default: null }
-  customerId: { default: null }
+  debug       : { default: false, transform: transform.bool },
+  verbose     : { default: false, transform: transform.bool },
+  embed       : { default: true,  transform: transform.bool },
+  autoStart   : { default: true,  transform: transform.bool },
+  accessToken : { default: null }
+  customerId  : { default: null }
 }
+
+getAttribute = (el, k)->
+  el.getAttribute(dasherize(k)) || el.getAttribute(k)
 
 getParamValue = (el, param, key)->
   keys = [key].concat(param.altKeys || [])
   transform = param.transform || (o)-> o
   value = _.reduce(keys, (ret, k)->
     if ret == null
-      value = transform((el.getAttribute(dasherize(k)) || el.getAttribute(k)), key)
-      valid = value? && (!param.validation  || param.validation(value, k))
+      value = transform(getAttribute(el, k), key)
+      valid = value? && (!param.validation  || param.validation(value, k, el))
       ret = value if valid
     ret
   , null)

    check

  https: (val, key)->
    check = /^https:|^\/\//.test(val)
    return check if document.location.protocol == 'https:' and check
    logger.warn("[Hull.init] #{key} should be loaded via https. Current value is ", val)
    check
    true


transform =

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

      config = false
    config
  , {}
  logger.error("[Hull.init] jsUrl NEEDS be loaded via https if orgUrl is https ") if httpsRegex.test(out.orgUrl) and not httpsRegex.test(out.jsUrl)
  out
