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

@waves/event-sender

Package Overview
Dependencies
Maintainers
17
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@waves/event-sender - npm Package Compare versions

Comparing version 0.5.0 to 0.5.2

2

dist/analytics-iframe.js

@@ -12,3 +12,3 @@ (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){

bus.on('has-referrer', function (referrer) {
Object.defineProperty(document, 'referrer', {
Object.defineProperty(Document.prototype, 'referrer', {
get: function () { return referrer; }

@@ -15,0 +15,0 @@ });

{
"name": "@waves/event-sender",
"version": "0.5.0",
"version": "0.5.2",
"description": "An interface for sending analytics events from Waves JS applications",

@@ -5,0 +5,0 @@ "main": "dist/analytics.js",

@@ -5,48 +5,1 @@ ## Event Sender

---
Usage:
```javascript
import EventSender from '@waves/event-sender';
// EventSender is a singleton, so any new attemps at instantiation
// will return a reference to a previously created instance
const sender = new EventSender();
// E.g.
const sender2 = new EventSender();
sender === sender2 // true
// Static method .inactive() returns an instance of EventSender that queues events,
// but does not send them until .activate() method is called
const sender = EventSender.inactive();
// (!) If an EventSender instance has been activated before, this will
// return a reference to it, so it WILL be active.
/** Queue custom event */
sender.push('Product', 'GetClientClick', 'my_custom_label', 2.0);
/**
* Queue page view
* Useful for SPA page transitions when no
* pageView event is tracked by default.
*/
sender.pushPageView(window.location.href, document.referrer);
// Enables sending events, including those queued before.
sender.activate();
// EventSender methods are chainable:
sender
.activate()
.push('Product', 'GetClientClick', 'my_custom_label', 2.0)
.pushPageView(window.location.href, document.referrer)
.push('Home', 'Subscribe');
```
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