Skip to content

[BREAKING] Environments and removal of link-to

Compare
Choose a tag to compare
@poteto poteto released this 05 Oct 17:10
· 606 commits to master since this release

This release is a breaking one – mainly, the augmented link-to component has been removed. You should track an event by sending an action instead.

A new feature addition is the ability to select which environments an adapter is activated against. By default, your adapter will be active in all environments. To specify which, simply add an environments property to your configuration:

module.exports = function(environment) {
  var ENV = {
    metricsAdapters: [
      {
        name: 'GoogleAnalytics',
        environments: ['development', 'production'],
        config: {
          id: 'UA-XXXX-Y'
        }
      },
      {
        name: 'Mixpanel',
        environments: ['production']
        config: {
          token: '0f76c037-4d76-4fce-8a0f-a9a8f89d1453'
        }
      },
      {
        name: 'LocalAdapter',
        environments: ['all'] // default, equivalent to ['development', 'test', 'production'],
        config: {
          foo: 'bar'
        }
      }
    ]
  }
}