posthog-js
Advanced tools
Comparing version 1.7.0-alpha.1 to 1.7.0-beta.1
@@ -40,4 +40,2 @@ // Type definitions for exported methods | ||
* | ||
* To capture link clicks or form submissions, see capture_links() or capture_forms(). | ||
* | ||
* @param {String} event_name The name of the event. This can be anything the user does - 'Button Click', 'Sign Up', 'Item Purchased', etc. | ||
@@ -47,3 +45,3 @@ * @param {Object} [properties] A set of properties to include with the event you're sending. These describe the user who did the event or details about the event itself. | ||
* @param {String} [options.transport] Transport method for network request ('XHR' or 'sendBeacon'). | ||
* @param {Function} [callback] If provided, the callback function will be called after capturing the event. | ||
* @param {Function} [callback] [Deprecated] If provided, the callback function will be called after capturing the event. | ||
*/ | ||
@@ -58,69 +56,2 @@ static capture( | ||
/** | ||
* Capture clicks on a set of document elements. Selector must be a | ||
* valid query. Elements must exist on the page at the time capture_links is called. | ||
* | ||
* ### Usage: | ||
* | ||
* // capture click for link id #nav | ||
* posthog.capture_links('#nav', 'Clicked Nav Link'); | ||
* | ||
* ### Notes: | ||
* | ||
* This function will wait up to 300 ms for the PostHog | ||
* servers to respond. If they have not responded by that time | ||
* it will head to the link without ensuring that your event | ||
* has been captured. To configure this timeout please see the | ||
* set_config() documentation below. | ||
* | ||
* If you pass a function in as the properties argument, the | ||
* function will receive the DOMElement that triggered the | ||
* event as an argument. You are expected to return an object | ||
* from the function; any properties defined on this object | ||
* will be sent to posthog as event properties. | ||
* | ||
* @type {Function} | ||
* @param {Object|String} query A valid DOM query, element or jQuery-esque list | ||
* @param {String} event_name The name of the event to capture | ||
* @param {Object|Function} [properties] A properties object or function that returns a dictionary of properties when passed a DOMElement | ||
*/ | ||
static capture_links( | ||
query: any, | ||
event_name: string, | ||
properties?: posthog.Properties | ((element: Element) => posthog.Properties) | ||
): any | ||
/** | ||
* Capture form submissions. Selector must be a valid query. | ||
* | ||
* ### Usage: | ||
* | ||
* // capture submission for form id 'register' | ||
* posthog.capture_forms('#register', 'Created Account'); | ||
* | ||
* ### Notes: | ||
* | ||
* This function will wait up to 300 ms for the posthog | ||
* servers to respond, if they have not responded by that time | ||
* it will head to the link without ensuring that your event | ||
* has been captured. To configure this timeout please see the | ||
* set_config() documentation below. | ||
* | ||
* If you pass a function in as the properties argument, the | ||
* function will receive the DOMElement that triggered the | ||
* event as an argument. You are expected to return an object | ||
* from the function; any properties defined on this object | ||
* will be sent to posthog as event properties. | ||
* | ||
* @type {Function} | ||
* @param {Object|String} query A valid DOM query, element or jQuery-esque list | ||
* @param {String} event_name The name of the event to capture | ||
* @param {Object|Function} [properties] This can be a set of properties, or a function that returns a set of properties after being passed a DOMElement | ||
*/ | ||
static capture_forms( | ||
query: any, | ||
event_name: string, | ||
properties?: posthog.Properties | ((element: Element) => posthog.Properties) | ||
): any | ||
/** | ||
* Capture a page view event, which is currently ignored by the server. | ||
@@ -310,6 +241,2 @@ * This function is called by default on page load unless the | ||
* | ||
* // the amount of time capture_links will | ||
* // wait for PostHog's servers to respond | ||
* capture_links_timeout: 300 | ||
* | ||
* // should we capture a page view on page load | ||
@@ -545,3 +472,2 @@ * capture_pageview: true | ||
debug?: boolean | ||
capture_links_timeout?: number | ||
cookie_expiration?: number | ||
@@ -548,0 +474,0 @@ upgrade?: boolean |
{ | ||
"name": "posthog-js", | ||
"version": "1.7.0-alpha.1", | ||
"version": "1.7.0-beta.1", | ||
"description": "Posthog-js allows you to automatically capture usage and send events to PostHog.", | ||
@@ -13,5 +13,5 @@ "repository": "https://github.com/PostHog/posthog-js", | ||
"build-module": "./node_modules/.bin/rollup -i src/loader-module.js -f cjs -o dist/module.js -c rollup.config.js", | ||
"process-types": "eslint src --ext .ts -c .eslintrc.ts.js --fix && tsc && cp -f src/*.d.ts dist/", | ||
"process-types": "mkdir -p dist; eslint src --ext .ts -c .eslintrc.ts.js --fix && tsc && cp -f src/*.d.ts dist/", | ||
"lint": "eslint src --fix", | ||
"prepublish": "yarn lint && yarn test && yarn build && yarn build-module && yarn process-types", | ||
"prepublishOnly": "yarn lint && yarn test && yarn build && yarn build-module && yarn process-types", | ||
"test": "jest src", | ||
@@ -18,0 +18,0 @@ "test-watch": "jest --watch", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
635526
5312