posthog-js 1.31.1 → 1.32.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/es.js CHANGED
@@ -881,7 +881,7 @@ var LZString = {
881
881
  }
882
882
  };
883
883
 
884
- var version = "1.31.1";
884
+ var version = "1.32.0";
885
885
 
886
886
  // e.g. Config.DEBUG = Config.DEBUG || instance.get_config('debug')
887
887
 
@@ -4055,6 +4055,36 @@ var Decide = /*#__PURE__*/function () {
4055
4055
  } else {
4056
4056
  this.instance['compression'] = {};
4057
4057
  }
4058
+
4059
+ if (response['inject']) {
4060
+ var _iterator2 = _createForOfIteratorHelper(response['inject']),
4061
+ _step2;
4062
+
4063
+ try {
4064
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
4065
+ var _step2$value = _step2.value,
4066
+ id = _step2$value.id,
4067
+ source = _step2$value.source,
4068
+ config = _step2$value.config;
4069
+
4070
+ try {
4071
+ var _window$eval, _window$eval2, _window$eval2$inject;
4072
+
4073
+ var apiHost = this.instance.get_config('api_host');
4074
+ (_window$eval = window.eval(source)) === null || _window$eval === void 0 ? void 0 : (_window$eval2 = _window$eval(apiHost)) === null || _window$eval2 === void 0 ? void 0 : (_window$eval2$inject = _window$eval2.inject) === null || _window$eval2$inject === void 0 ? void 0 : _window$eval2$inject.call(_window$eval2, {
4075
+ config: config,
4076
+ posthog: this.instance
4077
+ });
4078
+ } catch (e) {
4079
+ console.error("[POSTHOG-JS] Error while initializing PostHog app with config id ".concat(id), e);
4080
+ }
4081
+ }
4082
+ } catch (err) {
4083
+ _iterator2.e(err);
4084
+ } finally {
4085
+ _iterator2.f();
4086
+ }
4087
+ }
4058
4088
  }
4059
4089
  }]);
4060
4090