code: function Ifttt(config) {
    config = _.defaults(config || {}, {
      apiVersion: 'v1',
      authMode: 'header', // 'header', 'oauth2'
      logger: console,
      testAccessToken: ''
    });
  
    if (_.isUndefined(config.channelKey)) {
      throw new Error('Property `channelKey` is required.');
    }
  
    this.iftttApiVersion = config.apiVersion;
  
    // IFTTT channel key, needed for test setup verification.
    this.iftttChannelKey = config.channelKey;
  
    // IFTTT version basepath
    this.iftttBasepath = '/ifttt/' + this.iftttApiVersion;
  
    // IFTTT auth mode
    this.iftttAuthMode = config.authMode;
  
    // IFTTT test access token
    this.iftttTestAccessToken = config.testAccessToken;
  
    // Internal reference to desired logger.
    this.logger = config.logger; // Must support `info`, `error`, `warn`
  
    // Internal registry for actions & triggers.
    this.registry = {
      action: {},
      trigger: {}
    };
  
    // Internal registry for generic handlers.
    this.handlers = {
      status: null,
      user_info: null,
      test_setup_fake: null
    };
  
    // Internal storage of current user data for triggers / triggerFields.
    this.currentUserData = null;
  }
docs: Ifttt
  
  @param config
  @param config.apiVersion
  @param config.authMode
  @param config.channelKey
  @param config.logger
  @param config.testAccessToken
  
  @constructor
  @see https://developers.ifttt.com/docs/api_reference