@@ -10,7 +10,7 @@ export interface SessionRecorderBrowserTraceExporterConfig {
1010 /** URL for the OTLP endpoint. Defaults to Multiplayer's default traces endpoint. */
1111 url ?: string
1212 /** API key for authentication. Required. */
13- apiKey : string
13+ apiKey ? : string
1414 /** Additional headers to include in requests */
1515 headers ?: Record < string , string >
1616 /** Request timeout in milliseconds */
@@ -39,7 +39,7 @@ export class SessionRecorderBrowserTraceExporter implements SpanExporter {
3939 private readonly postMessageTargetOrigin : string
4040 private readonly config : SessionRecorderBrowserTraceExporterConfig
4141
42- constructor ( config : SessionRecorderBrowserTraceExporterConfig ) {
42+ constructor ( config : SessionRecorderBrowserTraceExporterConfig = { } ) {
4343 const {
4444 url = MULTIPLAYER_OTEL_DEFAULT_TRACES_EXPORTER_HTTP_URL ,
4545 apiKey,
@@ -155,8 +155,7 @@ export class SessionRecorderBrowserTraceExporter implements SpanExporter {
155155 url : this . config . url ,
156156 headers : {
157157 'Content-Type' : 'application/json' ,
158- 'User-Agent' : '@multiplayer-app/session-recorder-common/1.0.0' ,
159- 'Authorization' : this . config . apiKey ,
158+ ...( this . config . apiKey ? { 'Authorization' : this . config . apiKey } : { } ) ,
160159 ...( this . config . headers || { } ) ,
161160 } ,
162161 timeoutMillis : this . config . timeoutMillis ,
0 commit comments