Hardcode recorder API endpoints in build and runtime
This commit is contained in:
@@ -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,
|
||||
}),
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user