-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
executable file
·41 lines (39 loc) · 1.08 KB
/
main.js
File metadata and controls
executable file
·41 lines (39 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/**
*
*/
import PageViewManager from './plugins/view-manager';
import ErrorManager from './plugins/error-manger';
//import EventManager from './plugins/event-manger';
import {Logger, Sender} from './utils' ;
/**e
*
* @type {{agent: string, ui: {w: number, h: number}}}
*/
let config = {
apiURL: 'SDK_API_HOST',
version: 'SDK_VERSION',
wsURL: 'PUSH_URL',
token: null
};
/**
*
* @param token
* @param options
*/
window.unkAnalytics = function (token, options) {
if (!window.unkInitilaized) {
options = options || {};
config.token = token;
config.debug = options.debug;
Logger.setup(options);
let sender = new Sender(config, options);
ErrorManager.createManager(options, sender);
PageViewManager.createManager(options, sender);
window.unkInitilaized = true;
// add attributes and shortcuts
window.unkAnalytics.version = config.version;
window.unkAnalytics.off = sender.off.bind(sender);
window.unkAnalytics.on = sender.on.bind(sender);
}
//new EventManager(options, sender);
};