mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-16 17:46:45 +00:00
feat: Proxy all RudderStack frontend telemetry events through the backend (#17177)
Co-authored-by: Nikhil Kuriakose <nikhil.kuriakose@n8n.io>
This commit is contained in:
@@ -16,7 +16,7 @@ describe('telemetry', () => {
|
||||
setActivePinia(createPinia());
|
||||
settingsStore = useSettingsStore();
|
||||
telemetry.init(
|
||||
{ enabled: true, config: { url: '', key: '' } },
|
||||
{ enabled: true, config: { proxy: '', key: '', sourceConfig: '', url: '' } },
|
||||
{ versionCli: '1', instanceId: '1' },
|
||||
);
|
||||
});
|
||||
|
||||
@@ -47,7 +47,7 @@ export class Telemetry {
|
||||
if (!telemetrySettings.enabled || !telemetrySettings.config || this.rudderStack) return;
|
||||
|
||||
const {
|
||||
config: { key, url },
|
||||
config: { key, proxy, sourceConfig },
|
||||
} = telemetrySettings;
|
||||
|
||||
const settingsStore = useSettingsStore();
|
||||
@@ -57,10 +57,10 @@ export class Telemetry {
|
||||
|
||||
const logging = logLevel === 'debug' ? { logLevel: 'DEBUG' } : {};
|
||||
|
||||
this.initRudderStack(key, url, {
|
||||
this.initRudderStack(key, proxy, {
|
||||
integrations: { All: false },
|
||||
loadIntegration: false,
|
||||
configUrl: 'https://api-rs.n8n.io',
|
||||
configUrl: sourceConfig,
|
||||
...logging,
|
||||
});
|
||||
|
||||
@@ -201,7 +201,7 @@ export class Telemetry {
|
||||
}
|
||||
}
|
||||
|
||||
private initRudderStack(key: string, url: string, options: IDataObject) {
|
||||
private initRudderStack(key: string, proxy: string, options: IDataObject) {
|
||||
window.rudderanalytics = window.rudderanalytics || [];
|
||||
if (!this.rudderStack) {
|
||||
return;
|
||||
@@ -252,7 +252,7 @@ export class Telemetry {
|
||||
};
|
||||
|
||||
this.rudderStack.loadJS();
|
||||
this.rudderStack.load(key, url, options);
|
||||
this.rudderStack.load(key, proxy, options);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user