Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fathom-client

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fathom-client - npm Package Compare versions

Comparing version 3.4.1 to 3.5.0

9

dist/fathom-client.cjs.js

@@ -167,2 +167,10 @@ 'use strict';

/**
* Checks if tracking is enabled for the current vistior
*/
var isTrackingEnabled = function isTrackingEnabled() {
var preferenceStorage = localStorage.getItem('blockFathomTracking');
return preferenceStorage !== null ? preferenceStorage !== 'true' : true;
};
/**
* Sets the Site ID.

@@ -186,2 +194,3 @@ *

exports.enableTrackingForMe = enableTrackingForMe;
exports.isTrackingEnabled = isTrackingEnabled;
exports.load = load;

@@ -188,0 +197,0 @@ exports.setSite = setSite;

10

dist/fathom-client.esm.js

@@ -163,2 +163,10 @@ // refer to https://usefathom.com/support/tracking-advanced

/**
* Checks if tracking is enabled for the current vistior
*/
var isTrackingEnabled = function isTrackingEnabled() {
var preferenceStorage = localStorage.getItem('blockFathomTracking');
return preferenceStorage !== null ? preferenceStorage !== 'true' : true;
};
/**
* Sets the Site ID.

@@ -180,2 +188,2 @@ *

export { blockTrackingForMe, enableTrackingForMe, load, setSite, trackGoal, trackPageview };
export { blockTrackingForMe, enableTrackingForMe, isTrackingEnabled, load, setSite, trackGoal, trackPageview };

@@ -69,2 +69,6 @@ interface Fathom {

/**
* Checks if tracking is enabled for the current vistior
*/
export declare const isTrackingEnabled: () => boolean;
/**
* Sets the Site ID.

@@ -71,0 +75,0 @@ *

{
"name": "fathom-client",
"version": "3.4.1",
"version": "3.5.0",
"description": "A simple wrapper around the Fathom Analytics library",

@@ -51,2 +51,8 @@ "keywords": [

},
"jest": {
"resetMocks": false,
"setupFiles": [
"jest-localstorage-mock"
]
},
"devDependencies": {

@@ -59,2 +65,3 @@ "@babel/core": "^7.6.4",

"jest": "^27.4",
"jest-localstorage-mock": "^2.4.21",
"lint-staged": "^12.1.7",

@@ -61,0 +68,0 @@ "np": "^7.6.0",

@@ -147,2 +147,24 @@ # Fathom Client [![CircleCI](https://circleci.com/gh/derrickreimer/fathom-client.svg?style=svg)](https://circleci.com/gh/derrickreimer/fathom-client)

### `isTrackingEnabled()`
Checks if tracking is enabled for the current visitor.
See https://usefathom.com/docs/features/exclude.
#### Arguments
None.
#### Returns
Boolean.
#### Example
```js
import { isTrackingEnabled } from 'fathom-client';
const check = isTrackingEnabled(); // `true` by default
```
### `setSite(id: string)`

@@ -180,4 +202,6 @@

// Record a pageview when route changes
Router.events.on('routeChangeComplete', () => {
Fathom.trackPageview();
Router.events.on('routeChangeComplete', (as, routeProps) => {
if (!routeProps.shallow) {
Fathom.trackPageview();
}
});

@@ -184,0 +208,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc