@amplitude/analytics-react-native 0.0.1-dev.8 → 0.0.1-dev.9
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/lib/commonjs/version.js +1 -1
- package/lib/commonjs/version.js.map +1 -1
- package/lib/module/version.js +1 -1
- package/lib/module/version.js.map +1 -1
- package/lib/typescript/version.d.ts +1 -1
- package/package.json +2 -1
- package/src/attribution/campaign-parser.ts +78 -0
- package/src/attribution/campaign-tracker.ts +112 -0
- package/src/attribution/constants.ts +32 -0
- package/src/config.ts +227 -0
- package/src/cookie-migration/index.ts +54 -0
- package/src/index.ts +21 -0
- package/src/plugins/context.ts +106 -0
- package/src/plugins/identity.ts +21 -0
- package/src/react-native-client.ts +332 -0
- package/src/session-manager.ts +81 -0
- package/src/storage/cookie.ts +97 -0
- package/src/storage/local-storage.ts +67 -0
- package/src/storage/utm-cookie.ts +27 -0
- package/src/transports/fetch.ts +23 -0
- package/src/typings/browser-snippet.d.ts +7 -0
- package/src/typings/ua-parser.d.ts +4 -0
- package/src/utils/analytics-connector.ts +5 -0
- package/src/utils/cookie-name.ts +9 -0
- package/src/utils/language.ts +7 -0
- package/src/utils/platform.ts +9 -0
- package/src/utils/query-params.ts +18 -0
- package/src/version.ts +1 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { isNative } from './platform';
|
|
2
|
+
|
|
3
|
+
export const getQueryParams = (): Record<string, string | undefined> => {
|
|
4
|
+
/* istanbul ignore if */
|
|
5
|
+
if (isNative() || typeof window === 'undefined') {
|
|
6
|
+
return {};
|
|
7
|
+
}
|
|
8
|
+
const pairs = window.location.search.substring(1).split('&').filter(Boolean);
|
|
9
|
+
const params = pairs.reduce<Record<string, string | undefined>>((acc, curr) => {
|
|
10
|
+
const [key, value = ''] = curr.split('=', 2);
|
|
11
|
+
if (!value) {
|
|
12
|
+
return acc;
|
|
13
|
+
}
|
|
14
|
+
acc[decodeURIComponent(key)] = decodeURIComponent(value);
|
|
15
|
+
return acc;
|
|
16
|
+
}, {});
|
|
17
|
+
return params;
|
|
18
|
+
};
|
package/src/version.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const VERSION = '0.0.1-dev.9';
|