#Methods

#Audit

#noConflict

.noConflict(): this

If an Audit object already exists in the global object of the current page, the Audit.js library will be renamed to PooolAudit and the original Audit object will be restored.

#init

.init(appId: String): this

Initializes Audit using your app ID.

#sendEvent

.sendEvent(eventName: String, data?: Object, options?: AuditOptions): Promise

Sends an audit event.

#Available events

#page-view

#Options

#beacon
  • Type: Boolean
  • Default: false
Sends the event using the Beacon API (navigator.sendBeacon) to avoid loosing requests sent right before a redirect (like a click over a button).

#config

.config(optionName: String, optionValue: Any, readOnly?: Boolean): this

.config(options: Object, readOnly?: Boolean): this

Allows to set some configuration options. See the configuration options documentation.

#on

.on(name: String, callback: Function): this

Allows to set a callback to be called when a specific event is triggered. See the events documentation.

#once

.once(name: String, callback: Function): this
Same as .on() but the callback will be called only once and removed afterwards.

#off

.off(name: String, callback: Function): this
Allows to remove an event callback previously set with .on() or .once().