authscape 1.0.588 → 1.0.590

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/index.js CHANGED
@@ -16,6 +16,7 @@ var _nookies = require("nookies");
16
16
  var _router = _interopRequireDefault(require("next/router"));
17
17
  var _ga4React = _interopRequireDefault(require("ga-4-react"));
18
18
  var _zustand = require("zustand");
19
+ var _reactMicrosoftClarity = require("react-microsoft-clarity");
19
20
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
20
21
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
21
22
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -240,6 +241,14 @@ function AuthScapeApp(_ref) {
240
241
  if (process.env.googleAnalytics4 != "") {
241
242
  initGA(process.env.googleAnalytics4);
242
243
  }
244
+ if (process.env.microsoftClarityTrackingCode != "") {
245
+ _reactMicrosoftClarity.clarity.init(process.env.microsoftClarityTrackingCode);
246
+ if (signedInUser.current != null && _reactMicrosoftClarity.clarity.hasStarted()) {
247
+ _reactMicrosoftClarity.clarity.identify('USER_ID', {
248
+ userProperty: signedInUser.current.id.toString()
249
+ });
250
+ }
251
+ }
243
252
  databaseDrivenPageView(window.location.pathname);
244
253
  _router["default"].events.on('routeChangeComplete', function () {
245
254
  if (ga4React != null) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "authscape",
3
- "version": "1.0.588",
3
+ "version": "1.0.590",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -51,6 +51,7 @@
51
51
  "react-device-detect": "^2.2.3",
52
52
  "react-draft-wysiwyg": "^1.15.0",
53
53
  "react-hook-form": "^7.50.1",
54
+ "react-microsoft-clarity": "^1.2.0",
54
55
  "react-toastify": "^9.1.3",
55
56
  "styled-components": "^5.3.6",
56
57
  "use-places-autocomplete": "^4.0.0",
@@ -9,6 +9,7 @@ import { setCookie } from 'nookies';
9
9
  import Router from 'next/router';
10
10
  import GA4React from 'ga-4-react';
11
11
  import { create } from 'zustand'
12
+ import { clarity } from 'react-microsoft-clarity';
12
13
 
13
14
  // comment this out
14
15
  // import { authService, apiService, setupOEMProps, OEMStyleSheet } from 'authscape';
@@ -202,6 +203,16 @@ export function AuthScapeApp ({Component, layout, loadingLayout, pageProps, muiT
202
203
  initGA(process.env.googleAnalytics4);
203
204
  }
204
205
 
206
+ if (process.env.microsoftClarityTrackingCode != "")
207
+ {
208
+ clarity.init(process.env.microsoftClarityTrackingCode);
209
+
210
+ if (signedInUser.current != null && clarity.hasStarted())
211
+ {
212
+ clarity.identify('USER_ID', { userProperty: signedInUser.current.id.toString() });
213
+ }
214
+ }
215
+
205
216
  databaseDrivenPageView(window.location.pathname);
206
217
  Router.events.on('routeChangeComplete', () => {
207
218