Skip to content

Commit 2b90229

Browse files
committed
use headers for optional params
1 parent 466268f commit 2b90229

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/dispatch-queue.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,15 @@ export class DispatchQueue {
3838
if(this.queue.length === 0) return
3939
const events = this.queue;
4040
this.queue = []
41-
await fetch(`${this.config.url || "https://events.baselime.io/v1"}/${this.config.dataset || "web"}/${this.config.service || window.location.hostname}`, {
41+
await fetch(`${this.config.url || "https://events.baselime.io/v1"}/${this.config.dataset || "web"}`, {
4242
method: 'POST',
4343
headers: {
4444
contentType: 'application/json',
4545
'x-api-key': this.config.apiKey,
4646
'user-agent': '@baselime/react-rum/0.1.5',
47-
'library': '@baselime/react-rum/0.1.5'
47+
'library': '@baselime/react-rum/0.1.5',
48+
'x-service': this.config.service || window.location.hostname,
49+
'x-namespace': this.config.namespace || window.location.pathname,
4850
},
4951
body: JSON.stringify(events.map(event => ({
5052
userId: this.config.userId, sessionId: this.config.sessionId, pageLoadId: this.config.pageLoadId, namespace: this.config.namespace || window.location.pathname, ...event

0 commit comments

Comments
 (0)