# Define function/callbacks in ENV?

**URL:** <https://discuss.emberjs.com/t/define-function-callbacks-in-env/15607>\
**Category:** Ember CLI\
**Created:** [October 8, 2018, 6:46am UTC](https://discuss.emberjs.com/t/define-function-callbacks-in-env/15607 "2018-10-08T06:46:11Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![chilicoder](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/chilicoder/32/12721_2.png) [@chilicoder](https://discuss.emberjs.com/u/chilicoder)\
**Post date:** [October 26, 2018, 10:51am UTC](https://discuss.emberjs.com/t/define-function-callbacks-in-env/15607/4 "2018-10-26T10:51:01Z")

</div>

there is a similar thing done for trackjs wrapper [https://github.com/jherdman/ember-cli-trackjs#one-caveat](https://github.com/jherdman/ember-cli-trackjs#one-caveat)

```auto
// app/instance-initializers/configure-trackjs.js

export function initialize(application) {
  const trackJs = application.container.lookup('service:trackjs');

  trackJs.configure({
    onError(payload, err) {
      // exclude errors from log in page
      if (payload.url && payload.url.indexOf('login') > 0) {
        return false;
      }

      return true;
    }
  });
}

export default {
  name: 'trackjs-error-and-serializer-configuration',
  initialize: initialize
}

```

Maybe you could do the same here

---

_[View the full topic](https://discuss.emberjs.com/t/define-function-callbacks-in-env/15607)._
