Skip to content

Commit

Permalink
fix(session replay): add version option into local config generation
Browse files Browse the repository at this point in the history
  • Loading branch information
jxiwang committed Sep 23, 2024
1 parent e33f45a commit 7993104
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/session-replay-browser/src/config/local-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@ import { Config, Logger } from '@amplitude/analytics-core';
import { LogLevel } from '@amplitude/analytics-types';
import { DEFAULT_SAMPLE_RATE, DEFAULT_SERVER_ZONE } from '../constants';
import { SessionReplayOptions } from '../typings/session-replay';
import { SessionReplayLocalConfig as ISessionReplayLocalConfig, InteractionConfig, PrivacyConfig } from './types';
import {
SessionReplayLocalConfig as ISessionReplayLocalConfig,
InteractionConfig,
PrivacyConfig,
SessionReplayVersion,
} from './types';

export const getDefaultConfig = () => ({
flushMaxRetries: 2,
Expand All @@ -20,6 +25,7 @@ export class SessionReplayLocalConfig extends Config implements ISessionReplayLo
debugMode?: boolean;
configEndpointUrl?: string;
shouldInlineStylesheet?: boolean;
version?: SessionReplayVersion;

constructor(apiKey: string, options: SessionReplayOptions) {
const defaultConfig = getDefaultConfig();
Expand All @@ -38,6 +44,7 @@ export class SessionReplayLocalConfig extends Config implements ISessionReplayLo
this.serverZone = options.serverZone || DEFAULT_SERVER_ZONE;
this.configEndpointUrl = options.configEndpointUrl;
this.shouldInlineStylesheet = options.shouldInlineStylesheet;
this.version = options.version;

if (options.privacyConfig) {
this.privacyConfig = options.privacyConfig;
Expand Down

0 comments on commit 7993104

Please sign in to comment.