mirror of
https://github.com/enso-org/enso.git
synced 2024-09-20 17:52:16 +03:00
move hardcoded mixpanel token to the config (#3954)
Remove hardcoded mixpanel token and move it to the config class. This will allow for injection cloud's id and distinguish Enso Ide project from Enso Cloud in mixpanel.
This commit is contained in:
parent
cd172dad80
commit
8300d2f823
@ -58,6 +58,7 @@ ensogl::read_args! {
|
||||
node_labels : bool,
|
||||
crash_report_host : String,
|
||||
data_gathering : bool,
|
||||
mixpanel_token : String,
|
||||
is_in_cloud : bool,
|
||||
verbose : bool,
|
||||
authentication_enabled : bool,
|
||||
|
@ -39,7 +39,7 @@ class ContentApi {
|
||||
|
||||
initLogging(config: Config) {
|
||||
if (config.data_gathering) {
|
||||
this.logger = new MixpanelLogger()
|
||||
this.logger = new MixpanelLogger(config.mixpanel_token)
|
||||
if (ok(config.email)) {
|
||||
this.logger.identify(config.email)
|
||||
}
|
||||
@ -204,13 +204,9 @@ function printScamWarning() {
|
||||
class MixpanelLogger {
|
||||
private readonly mixpanel: any
|
||||
|
||||
constructor() {
|
||||
constructor(mixpanel_token: string) {
|
||||
this.mixpanel = require('mixpanel-browser')
|
||||
this.mixpanel.init(
|
||||
'5b541aeab5e08f313cdc1d1bbebc12ac',
|
||||
{ api_host: 'https://api-eu.mixpanel.com' },
|
||||
''
|
||||
)
|
||||
this.mixpanel.init(mixpanel_token, { api_host: 'https://api-eu.mixpanel.com' }, '')
|
||||
}
|
||||
|
||||
log(event: string, data: any) {
|
||||
@ -764,6 +760,7 @@ class Config {
|
||||
public node_labels: boolean = true
|
||||
public crash_report_host: string = defaultLogServerHost
|
||||
public data_gathering: boolean = true
|
||||
public mixpanel_token: string = '5b541aeab5e08f313cdc1d1bbebc12ac'
|
||||
public is_in_cloud: boolean = false
|
||||
public verbose: boolean = false
|
||||
public authentication_enabled: boolean = true
|
||||
|
Loading…
Reference in New Issue
Block a user