public function init()
    {
        if (!Yii::$app->has('bugsnag'))
        {
            throw new InvalidConfigException('BugsnagAsset requires Bugsnag component to be enabled');
        }

        if (!in_array($this->version, [2, 3]))
        {
            throw new InvalidConfigException('Bugsnag javascript only supports version 2 or 3');
        }

        $this->registerJavascript();

        parent::init();
    }