mixpanel-browser 2.69.0 → 2.70.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/CHANGELOG.md +3 -0
- package/dist/mixpanel-core.cjs.js +14 -10
- package/dist/mixpanel-recorder.js +1 -1
- package/dist/mixpanel-recorder.min.js +1 -1
- package/dist/mixpanel-recorder.min.js.map +1 -1
- package/dist/mixpanel-with-async-recorder.cjs.js +14 -10
- package/dist/mixpanel-with-recorder.js +14 -10
- package/dist/mixpanel-with-recorder.min.js +1 -1
- package/dist/mixpanel.amd.js +14 -10
- package/dist/mixpanel.cjs.js +14 -10
- package/dist/mixpanel.globals.js +14 -10
- package/dist/mixpanel.min.js +82 -81
- package/dist/mixpanel.module.js +14 -10
- package/dist/mixpanel.umd.js +14 -10
- package/package.json +6 -1
- package/src/config.js +1 -1
- package/src/flags/index.js +14 -9
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mixpanel-browser",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.70.0",
|
|
4
4
|
"description": "The official Mixpanel JavaScript browser client library",
|
|
5
5
|
"main": "dist/mixpanel.cjs.js",
|
|
6
6
|
"module": "dist/mixpanel.module.js",
|
|
@@ -33,6 +33,11 @@
|
|
|
33
33
|
"types": "./src/index.d.ts",
|
|
34
34
|
"import": "./src/loaders/loader-module-with-async-recorder.js",
|
|
35
35
|
"require": "./src/loaders/loader-module-with-async-recorder.js"
|
|
36
|
+
},
|
|
37
|
+
".": {
|
|
38
|
+
"types": "./src/index.d.ts",
|
|
39
|
+
"import": "./dist/mixpanel.module.js",
|
|
40
|
+
"require": "./dist/mixpanel.cjs.js"
|
|
36
41
|
}
|
|
37
42
|
},
|
|
38
43
|
"repository": {
|
package/src/config.js
CHANGED
package/src/flags/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { _, console_with_prefix, safewrapClass } from '../utils'; // eslint-disable-line camelcase
|
|
2
2
|
import { window } from '../window';
|
|
3
|
+
import Config from '../config';
|
|
3
4
|
|
|
4
5
|
var fetch = window['fetch'];
|
|
5
6
|
var logger = console_with_prefix('flags');
|
|
@@ -87,17 +88,21 @@ FeatureFlagManager.prototype.fetchFlags = function() {
|
|
|
87
88
|
var distinctId = this.getMpProperty('distinct_id');
|
|
88
89
|
var deviceId = this.getMpProperty('$device_id');
|
|
89
90
|
logger.log('Fetching flags for distinct ID: ' + distinctId);
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
91
|
+
|
|
92
|
+
var context = _.extend({'distinct_id': distinctId, 'device_id': deviceId}, this.getConfig(CONFIG_CONTEXT));
|
|
93
|
+
var searchParams = new URLSearchParams();
|
|
94
|
+
searchParams.set('context', JSON.stringify(context));
|
|
95
|
+
searchParams.set('token', this.getMpConfig('token'));
|
|
96
|
+
searchParams.set('mp_lib', 'web');
|
|
97
|
+
searchParams.set('$lib_version', Config.LIB_VERSION);
|
|
98
|
+
var url = this.getFullApiRoute() + '?' + searchParams.toString();
|
|
99
|
+
|
|
93
100
|
this._fetchInProgressStartTime = Date.now();
|
|
94
|
-
this.fetchPromise = window['fetch'](
|
|
95
|
-
'method': '
|
|
101
|
+
this.fetchPromise = window['fetch'](url, {
|
|
102
|
+
'method': 'GET',
|
|
96
103
|
'headers': {
|
|
97
|
-
'Authorization': 'Basic ' + btoa(this.getMpConfig('token') + ':')
|
|
98
|
-
|
|
99
|
-
},
|
|
100
|
-
'body': JSON.stringify(reqParams)
|
|
104
|
+
'Authorization': 'Basic ' + btoa(this.getMpConfig('token') + ':')
|
|
105
|
+
}
|
|
101
106
|
}).then(function(response) {
|
|
102
107
|
this.markFetchComplete();
|
|
103
108
|
return response.json().then(function(responseBody) {
|