Hardcode recorder API endpoints in build and runtime
This commit is contained in:
@@ -15,9 +15,6 @@ export default {
|
|||||||
commonjs(),
|
commonjs(),
|
||||||
replace({
|
replace({
|
||||||
__COLLECT_API_HOST__: process.env.COLLECT_API_HOST || '',
|
__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: ['', ''],
|
delimiters: ['', ''],
|
||||||
preventAssignment: true,
|
preventAssignment: true,
|
||||||
}),
|
}),
|
||||||
|
|||||||
@@ -18,8 +18,8 @@ import { record } from 'rrweb';
|
|||||||
const host =
|
const host =
|
||||||
hostUrl || '__COLLECT_API_HOST__' || currentScript.src.split('/').slice(0, -1).join('/');
|
hostUrl || '__COLLECT_API_HOST__' || currentScript.src.split('/').slice(0, -1).join('/');
|
||||||
const hostBase = host.replace(/\/$/, '');
|
const hostBase = host.replace(/\/$/, '');
|
||||||
const endpoint = `${hostBase}__COLLECT_REPLAY_ENDPOINT__`;
|
const endpoint = `${hostBase}/api/record`;
|
||||||
const configEndpoint = `${hostBase}__RECORDER_CONFIG_ENDPOINT__`.replace('{websiteId}', website);
|
const configEndpoint = `${hostBase}/api/websites/${website}/recorder`;
|
||||||
|
|
||||||
const REPLAY_FLUSH_EVENT_COUNT = 100;
|
const REPLAY_FLUSH_EVENT_COUNT = 100;
|
||||||
const REPLAY_FLUSH_INTERVAL = 2000;
|
const REPLAY_FLUSH_INTERVAL = 2000;
|
||||||
|
|||||||
Reference in New Issue
Block a user