Skip to content

armgit / umami

Public Imported from GitHub
0

Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.

Hardcode recorder API endpoints in build and runtime

Mike Caoa5f78e3e3d08
diff --git a/rollup.recorder.config.js b/rollup.recorder.config.js
index aa1794018..2f6607985 100644
--- a/rollup.recorder.config.js
+++ b/rollup.recorder.config.js
@@ -15,9 +15,6 @@ export default {
commonjs(),
replace({
__COLLECT_API_HOST__: process.env.COLLECT_API_HOST || '',
- __COLLECT_REPLAY_ENDPOINT__: process.env.COLLECT_REPLAY_ENDPOINT || '/api/record',
- __RECORDER_CONFIG_ENDPOINT__:
- process.env.RECORDER_CONFIG_ENDPOINT || '/api/websites/{websiteId}/recorder',
delimiters: ['', ''],
preventAssignment: true,
}),
diff --git a/src/recorder/index.js b/src/recorder/index.js
index 1d36341cb..3dad7fb97 100644
--- a/src/recorder/index.js
+++ b/src/recorder/index.js
@@ -18,8 +18,8 @@ import { record } from 'rrweb';
const host =
hostUrl || '__COLLECT_API_HOST__' || currentScript.src.split('/').slice(0, -1).join('/');
const hostBase = host.replace(/\/$/, '');
- const endpoint = `${hostBase}__COLLECT_REPLAY_ENDPOINT__`;
- const configEndpoint = `${hostBase}__RECORDER_CONFIG_ENDPOINT__`.replace('{websiteId}', website);
+ const endpoint = `${hostBase}/api/record`;
+ const configEndpoint = `${hostBase}/api/websites/${website}/recorder`;
const REPLAY_FLUSH_EVENT_COUNT = 100;
const REPLAY_FLUSH_INTERVAL = 2000;