From a5f78e3e3d08b90f25217784a852c022655713be Mon Sep 17 00:00:00 2001 From: Mike Cao Date: Mon, 15 Jun 2026 14:50:13 -0700 Subject: [PATCH] Hardcode recorder API endpoints in build and runtime --- rollup.recorder.config.js | 3 --- src/recorder/index.js | 4 ++-- 2 files changed, 2 insertions(+), 5 deletions(-) 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;