Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(session replay): add version option into local config generation #886

Merged
merged 2 commits into from
Sep 23, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
jxiwang marked this conversation as resolved.
Show resolved Hide resolved

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